Convert Object to JSON string
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: jQuery.parseJSON('{"name":"John"}') converts string representation to object but I want the reverse. Object is to be converted to JSON string I got a link http://www.devcurry.com/2010/03/convert-javascript-object-to-json.html but it need to have json2.js do jQuery has a native method to do this? 回答1: jQuery does only make some regexp checking before calling the native browser method window.JSON.parse() . If that is not available, it uses eval() or more exactly new Function() to create a Javascript object. The opposite of JSON.parse() is JSON