The eval problem occurred when processing the ajax callback function return value. it has been detected and processed successfully: var & nbsp; res = eval ("(" [{"fid ": "3", "sid": "3", "sonName": "chemistry" },{ "content": '& lt; p & gt; & lt; I am worried about the eval problem when img & nbsp; alt = "" & n ajax callback function return value processing
Detected and processed:
Var res = eval ("(" [{"fid": "3", "sid": "3", "sonName": "1st chemistry "}, {"content ":'
Wwwwrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrqqq
'}, {"Content ":'
Bytes
'}] ")");
Failed to be detected (not executed): var res = eval ("("
[{"Fid": "3", "sid": "10", "sonName": "4th chemistry" },{ "content ":'
'}, {"Content ":'
Dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
Sdddddddddddddddddddddddddd
'}]
")");
Let's take a look at why eval cannot be used to process the second ajax return value?
------ Solution --------------------
JavaScript strings do not contain line breaks. if necessary, escape them.