All current browsers have native JSON support built in. So as long as you're not dealing with prehistoric browsers like IE6/7 you can do it just as easily as that:
(当前所有的浏览器都内置了本机JSON支持。因此,只要您不使用IE6 / 7之类的史前浏览器,就可以像这样轻松地做到这一点:)
var j={"name":"binchen"};
JSON.stringify(j); // '{"name":"binchen"}'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…