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

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

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