Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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/8 crawl as a result.

I am wondering if there is a faster way to iterate through the entire data.

Thank you for your time.

share|improve this question
    
How are you iterating through it? Are you parsing it, or are you evaling it? Do you need just certain parts? –  altCognito Jun 26 '09 at 19:02
add comment

2 Answers

up vote 9 down vote accepted

some good clientside parsing & performance tips from flickr

share|improve this answer
    
Thats a really good article. Good keep in mind. –  Alex Jul 4 '09 at 0:45
add comment

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)'.

share|improve this answer
    
I assume Alec is using the json dataType in the xhr call therefore jquery will be eval'ing the response. –  redsquare Jun 26 '09 at 19:10
    
thats correct redsquare –  Alec Smart Jun 27 '09 at 5:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.