I am using a framework, which returns invalid JSON String like:
/* { "myobject" : "test"} */
The error is the comments before and after the json string. This has been invented for security reasons. As the www says returning JSON directly is somehow discouraged because it can be exploited. I am not a security expert at all but would like to go conform with this recommendation.
However, now I get this string above with header type “application/json”
Can I somehow hook into jQuery and tell it to remove /* */ from the json string by default?
thanks,
Christian
I found a solution with converters.
http://api.jquery.com/extending-ajax/#Converters