views:

26

answers:

1

I would like to know how to properly escape my json code. I am using the datatables plugin and this is the json that is failing.

        "6\\\\\\\' 5\\\\\\\" Ford HD ",

It originally looks like this (without the opening/closing brackets and the comma):

         6\\\' 5\\\" Ford HD 

How would I properly escape this?

A: 

You should not escape the ' character. So the correct JSON will be

"6\\\\\\' 5\\\\\\\" Ford HD "

A good place where you can validate your data is http://www.jsonlint.com/.

Oleg