How do you properly escape json to be sent over ajax? (Using Datatables) -


i know how escape json code. using datatables plugin , json failing.

        "6\\\\\\\' 5\\\\\\\" ford hd ", 

it looks (without opening/closing brackets , comma):

         6\\\' 5\\\" ford hd  

how escape this?

you should not escape ' character. correct json be

"6\\\\\\' 5\\\\\\\" ford hd " 

a place can validate data http://www.jsonlint.com/.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -