1
data={"convID":"E40E92FD4B410","serverDate":"2012/06/15 07:51:07 PM","masterInfo":{"instance":"808477149_R_BDD72269D1C1E98A32D8C83EC58CF471","appVersion":"0.97.13.D","depth":4,"jsonURL":"//testtn","scenario":"R","serverDate":"2012/06/15 07:51:07 PM ","deviceName":"M’s","localDate":"2012/5/6 11:14:59 AM PDT"}}
JSON.parse(data);
給出錯誤。這是由ruby腳本中的JSON.generate生成的,併發送給節點http服務器,應用decodeURIComponent獲取上面打印的數據。還是JSON解析失敗,此錯誤:甚至在解碼後,node.js中的JSON解析錯誤URL
undefined:1
ate":"2012/06/15
^
SyntaxError: Unexpected token d
at Object.parse (native)
謝謝,這個提示幫了我。 – user1447121
好。你應該[接受](http://meta.stackexchange.com/a/5235/188359)我的答案。 –