PDA

View Full Version : IE issues on reading JSON special characters



taxidriver
1 Jun 2011, 11:21 PM
Hello guys,

I have a grid(with a column address) that has a JSON reader and whenever the JSON data string contains special characters like:
{ "address": "\"Home\" Number " "}
it is never displayed in IE8.
In Firefox and Chrome it works perfectly.

I would appreciate any idea.

Thank you!

josephhamilton1
2 Jun 2011, 12:30 PM
Not sure if this is the problem, but your JSON is invalid

Here's a valid version of it:

{ "address": "\"Home\" Number \"" }

Notice the \ on the second to last double quote.

Happy Coding!

taxidriver
2 Jun 2011, 11:14 PM
Thank you very much for your reply,
Actually, after pasting my json file to http://jsonlint.com/ for validation it was valid.
I have added a custom renderer function to this column in order to replace the "invalid" characters and it has worked.
The only problem is that I have added a cell qtip also into the renderer function, but it does not show the corresponding value, although cell displays it.
Probably, it is needed a replacement of the "invalid" characters with the corresponding ASCII values.
Currently, I am trying to solve the issue following this way.

bazzapr
12 Jun 2011, 4:13 PM
I have registered to this forum to say THANK YOU TAXIDRIVER. Never knew of the link that allows you to validate your json file. 2 Days I have been asking and looking around. I HATE IE!! What a waste.

Thanks again mate. Really appreciate it.