jQuery的JSON插件 JSON Parser

openkk 13年前發布 | 35K 次閱讀 jQuery JSON開發包

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://www.baiduhome.net/lib/view/home/1324129958265

 本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!