javascript - Json is not validating with file content? -
i have tested json data normal content working fine.
sample data below:
working json
{ "language": "xyz", "content": { "gen": "this test", "exo": "this test" } }
not working json
{ "language": "xyz", "content": { "gen": "\id gen\n\c 1\n\p\n\v 1 in beginning god created heavens , earth.\n\v 2 , earth without form , void form.", "exo": "\id exo\n\c 1\n\p\n\v 1 these names of children of israel, came egypt; every man , household came jacob\n\v 2 reuben, simeon, levi, , judah" } }
for escape sequences, can convert object json string , parse below this
var obj= { "language": "xyz", "content": { "gen": "\id gen\n\c 1\n\p\n\v 1 in beginning god created heavens , earth.\n\v 2 , earth without form , void form.", "exo": "\id exo\n\c 1\n\p\n\v 1 these names of children of israel, came egypt; every man , household came jacob\n\v 2 reuben, simeon, levi, , judah" } }; var json= json.stringify(obj);
this more simple you.
Comments
Post a Comment