红联Linux门户
Linux帮助

jQuery的JSON插件 JSON Parser

发布时间:2013-07-16 09:23:01来源:红联作者:empast
This plugin makes it simple to convert to and from JSON.

Most people asked me why I would want to do such a thing, which boggles my mind. Javascript makes it relatively easy to convert from JSON, thanks to eval(), but converting to JSON is supposedly an edge requirement.

This plugin exposes four new functions onto the $, or jQuery object:

toJSON: Serializes a javascript object, number, string, or arry into JSON.
evalJSON: Converts from JSON to Javascript, quickly, and is trivial.
secureEvalJSON: Converts from JSON to Javascript, but does so while checking to see if the source is actually JSON, and not with other Javascript statements thrown in.
quoteString: Places quotes around a string, and inteligently escapes any quote, backslash, or control characters.

官方首页:http://archive.plugins.jquery.com/project/json

免费下载:http://archive.plugins.jquery.com/node/2288/release

来自:开源中国社区
文章评论

共有 0 条评论