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 -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -