Thursday, 12 May 2016

jQuery.parseJSON vs JSON.parse


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

Parent-Child class declaration and initialization

using System; namespace CSharpDemo {     public class A     {         public void print()         {             Console.Wr...