开发者

json for the dummies

I'm working with asp.net. What the following files for?

-json.js
-json2.js
-jsonp.js

So far, I've been able to serialize an object and 开发者_开发百科get it to the page. What can these files do?

Thanks.


from Mr. Crockfords github

json2.js: This file creates a JSON property in the global object, if there isn't already one, setting its value to an object containing a stringify method and a parse method. The parse method uses the eval method to do the parsing, guarding it with several regular expressions to defend against accidental code execution hazards. On current browsers, this file does nothing, prefering the built-in JSON object.

json.js: This file does everything that json2.js does. It also adds a toJSONString method and a parseJSON method to Object.prototype. Use of this file is not recommended.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜