我想用prduct但當上傳圖片,我看到錯誤jQuery的文件上傳語法錯誤:JSON.parse:後JSON數據意外非空白字符
語法錯誤:JSON.parse:意外的非空格字符後的JSON數據
script directory: Folder2
directory Jquery-file-upload: function/blueimp-jQuery-File-Upload/
in main.js i edit rows
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/'
});
上
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '../function/blueimp-jQuery-File-Upload/server/php/'
});
圖片真實保存在服務器上,但錯誤與他出示上傳後。
第一步 http://s55.radikal.ru/i149/1211/10/8c8d911589de.jpg
第二步,錯誤 http://s019.radikal.ru/i604/1211/8c/7e05d92b30ef.jpg
furebug響應請求
[{"name":"1353755388.jpg","size":879394,"type":"image\/jpeg","url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/files\/1353755388.jpg","thumbnail_url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/files\/thumbnail\/1353755388.jpg","upload_to_db":true,"delete_url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/?file=ExPRoG-1353755388.jpg","delete_type":"DELETE"}]/home/m/malishkaru/public_html/function/blueimp-jQuery-File-Upload/server/php
請告訴我爲什麼我有這個錯誤?何時出錯?
您顯示的「對請求的響應」不是有效的JSON,因爲在關閉']'之後的文本。如果您可以將PHP更改爲_not_,則會在關閉']後返回所有內容,您將擁有有效的JSON。 「意外的非空白字符」是在關閉']後的'/ home/m/etc'中的'/'。 – nnnnnn
謝謝。很好的回答) – Loki