$("#exec").click(function(){ var newPW = $("#newPW").val(); console.log("old newPW:" + newPW); var testPW = { test:newPW } //escape special charactors console.log("JSON.stringify:" + JSON.stringify(testPW)); });Reference:
Characters to escape in JSON
沒有留言:
張貼留言
留個話吧:)