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"    } } 

check screenshot working , not working json

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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -