jQuery.parseJSON and JSON.parse are two functions that perform the same task.
But If the jQuery library is already loaded, would using
jQuery.parseJSON be better than
using
JSON.parse.
jQuery will use the native
JSON.parse method if it is available, and otherwise it will try to evaluate the data with new Function, which is kind of like eval.
So yes, you should definitely use
jQuery.parseJSON.
No comments:
Post a Comment