php – Jquery文件上传SyntaxError:JSON.parse:JSON数据后出现意外的非空白字符

前端之家收集整理的这篇文章主要介绍了php – Jquery文件上传SyntaxError:JSON.parse:JSON数据后出现意外的非空白字符前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想使用产品但是当上传图片时我看到错误

SyntaxError: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/'
});

图像true保存在服务器上,但在上传显示错误.

步骤1
http://s55.radikal.ru/i149/1211/10/8c8d911589de.jpg

Step2有错误
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更改为在结束后不返回所有内容,那么您将拥有有效的JSON.

“意外的非空白字符”是关闭后的/ in / home / m / etc]

我在写/ home / m / malishkaru / public_html / function / blueimp -jQuery-File-Upload / server / PHP删除了部分代码.

P.S.:感谢nnnnnn.

P.P.S:仅回答密切问题.用户nnnnnn给出了很好的答案.

原文链接:https://www.f2er.com/php/444953.html

猜你在找的PHP相关文章