$.each() iterating over characters in a string - do I need to eval()?

Posted by b. e. hollenbeck on Stack Overflow See other posts from Stack Overflow or by b. e. hollenbeck
Published on 2010-05-04T04:08:52Z Indexed on 2010/05/04 4:18 UTC
Read the original article Hit count: 293

Filed under:
|
|
|

I have json data being returned as a collection:

var foo = ["6", "7", "33"]

using JSONP in jQuery. Since I'm using JSONP, the data is being returned to a callback function, which is interpreting it as a string instead of a collection. Do I need to run eval(foo) on the string in the callback before handling it as a collection, or is there some other means of recasting it?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON