首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当试图解析xhr响应文本时出错(JSON.parse: JSON数据后的意外非空格字符,位于JSON数据的第2列)

当试图解析xhr响应文本时出错(JSON.parse: JSON数据后的意外非空格字符,位于JSON数据的第2列)
EN

Stack Overflow用户
提问于 2016-08-15 14:01:21
回答 1查看 1.2K关注 0票数 1

我使用osclass脚本,当我想上传图片作为一个正常的用户,我得到这个错误,文件上传工作良好,但我看不到在管理面板的图片。欢迎任何建议。谢谢。->firebug报告:

代码语言:javascript
复制
    [FineUploader 3.8.0] Error when attempting to parse xhr response text (JSON.parse: unexpected non-whitespace character after JSON data at line 2 column 1 of the JSON data)
qq.log(a="[FineUploader 3.8.0] Err...umn 1 of the JSON data)", b="error")jquery.fineuploader.min.js (line 16)
qq.basePublicApi.log(a="Error when attempting to...umn 1 of the JSON data)", b="error")jquery.fineuploader.min.js (line 16)
qq.basePrivateApi._createUploadHandler/d.log(a="Error when attempting to...umn 1 of the JSON data)", b="error")jquery.fineuploader.min.js (line 16)
o()jquery.fineuploader.min.js (line 18)
s(a=0, b=Object { type="object"})jquery.fineuploader.min.js (line 18)
t/<()

这就是回应:

代码语言:javascript
复制
    {"success":true,"uploadName":"auto_qqfile_57b1bb265d971.jpg"}
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-82144916-1', 'auto');
  ga('send', 'pageview');
</script>

我已经检查了良好的上传脚本和源代码是相同的原始。那有什么问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-15 14:06:49

您的服务器正在返回无效数据。精细上传器期望有一个有效的JSON响应,正如您在错误消息中看到的那样,这是没有发生的。您需要仔细查看您的服务器代码。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38956552

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档