How to Safely turning a JSON string into an object ?
can do this unsafely with something like
but that leaves us vulnerable to the json string containing other code, which it seems very dangerous to simply eval.
The jQuery method is now deprecated. Use this method instead:
Use simple code represented in the following link on MSDN .
Calling evalJSON() with true as the argument sanitizes the incoming string.