jQuery.parseJSON vs JSON.parse

后端 未结 7 1174
感情败类
感情败类 2020-11-27 06:29

jQuery.parseJSON and JSON.parse are two functions that perform the same task. If the jQuery library is already loaded, would using jQuery.parseJSON be better th

相关标签:
7条回答
  • 2020-11-27 07:13

    I don't know about performance, but it's definitely safer to use the jQuery method because some browsers like ie7 and lower might not have any JSON functionalities natively.
    It's all about compatibility, just like you use jQuery's each method instead of the array's native forEach method for iteration.

    0 讨论(0)
提交回复
热议问题