Fastest way to iterate through JSON string in Javascript

前端 未结 2 826
不思量自难忘°
不思量自难忘° 2021-02-06 12:36

I have been using $.each of the jQuery framework to iterate through a JSON string that I receive via an AJAX call. Now this string is sometimes quite huge and as a result IE6/7/

2条回答
  •  半阙折子戏
    2021-02-06 13:04

    How about using the regular javascript functions?

    If for example you have a JSON object with items in them, you could just eval the JSON string to convert it to javascript objects, and iterate over them using 'for (i in object)'.

提交回复
热议问题