0
我的服務器返回以下JSON對象:當我運行var response = jQuery.parseJSON(data)
我收到以下錯誤JSON錯誤。意外的字符
{"Success":0,"ex":"The system cannot find the file specified"}
:
語法錯誤:JSON.parse:意外的字符
可有人請點我在正確的方向?謝謝!
我的服務器返回以下JSON對象:當我運行var response = jQuery.parseJSON(data)
我收到以下錯誤JSON錯誤。意外的字符
{"Success":0,"ex":"The system cannot find the file specified"}
:
語法錯誤:JSON.parse:意外的字符
可有人請點我在正確的方向?謝謝!
parseJSON
用於分析一個JSON字符串成Javascript對象。看起來你已經有了這個對象,你確定data
是一個字符串嗎?
謝謝。這是問題所在。 –
數據已經是一個對象,你不需要再應用parseJSON。 – PSL
是的,因爲它適用於字符串:http://jsfiddle.net/WX5yN/ –