jQuery的JSON插件 JSON Parser
openkk
13年前
<div id="p_fullcontent" class="detail"> <p>This plugin makes it simple to convert to and from JSON.</p> <p>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.</p> <p>This plugin exposes four new functions onto the $, or jQuery object:</p> <ul> <li><strong>toJSON</strong>: Serializes a javascript object, number, string, or arry into JSON.</li> <li><strong>evalJSON</strong>: Converts from JSON to Javascript, quickly, and is trivial.</li> <li><strong>secureEvalJSON</strong>: 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.</li> <li><strong>quoteString</strong>: Places quotes around a string, and inteligently escapes any quote, backslash, or control characters.</li> </ul> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1324129958265" target="_blank">http://www.open-open.com/lib/view/home/1324129958265</a></p> </div>