开发者

How to convert string to JSON object?

I am using jquery 1.3.2 and I can't use the parseJSON since it is added in 1.4.1 & I can't upg开发者_如何学JAVArade right now.

Is there any wat to get JSON object from string?

If this is a duplicate please send me the link.

Thanks for reading


You can use a couple of options, see here

  • Javascript eval function
  • JSON.parse() function

The eval function has some security issues associated with it, and the JSON.parse function has its own set of incompatibilities. I guess this is why JQuery has its own wrapper function. If you can't use JQuery 1.4+ though, these are two of your best options, without going looking for a specific JSON parsing library.


json2.js : http://www.json.org/js.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜