各種百度說這個錯誤是因為json格式不標注引起的這是后端php 用json_encode函數生成的json看了jquery的官方文檔似乎沒錯jQuery.parseJSON( json )Passing in a malformed JSON string will result in an exception being thrown. For example, the following are all malformed JSON strings:{test: 1} (test does not have double quotes around it). 譯:test兩邊必須有雙引號 {"test":1}{'test': 1} ('test' is using single quotes instead of double quotes). 譯:test兩邊的引號不能為單引號,一定要是雙引號Additionally if you pass in nothing, an empty string, null, or undefined, 'null' will be returned from parseJSON. Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see?http://json.org/.而且以前一直都是這么返回的都沒有出錯,請問那么正確的json標準格式應該是怎樣的?
jquery ajax無法獲取回調json,并且報告錯誤
蝴蝶不菲
2019-03-07 17:15:58