dth54864 2016-12-20 18:41 采纳率: 0%
浏览 88
已采纳

适用于localhost但不适用于实时网站。 未捕获的SyntaxError:位于0的JSON中的意外标记<

Anyone know what this error is indicating?

This script (paypal php virtual terminal) works great testing on localhost, but when I transfer the files to my web server the jquery/json hangs.

index.php:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Function.n.parseJSON (http://www..com/virtualterminal/bower_components/jquery/dist/jquery.min.js:4:5309)
at Object.success (http://www..com/virtualterminal/js/validate.js:80:46)
at j (http://www..com/virtualterminal/bower_components/jquery/dist/jquery.min.js:2:26911)
at Object.fireWith [as resolveWith] (http://www..com/virtualterminal/bower_components/jquery/dist/jquery.min.js:2:27724)
at x (http://www..comvirtualterminal/bower_components/jquery/dist/jquery.min.js:4:11065)
at XMLHttpRequest.<anonymous> (http://www..com/virtualterminal/bower_components/jquery/dist/jquery.min.js:4:14577)n.parseJSON @ jquery.js:7517success @ validate.js:80j @ jquery.js:3094fireWith @ jquery.js:3206x @ jquery.js:8259(anonymous function) @ jquery.js:8600

I'm checking the log files, and it looks like the sandbox payment is processing correctly... the only issue is that the jquery/json is not redirecting to the success page.

  • 写回答

1条回答 默认 最新

  • doushu2699 2016-12-20 18:47
    关注

    Anyone know what this error is indicating?

    The error you got is just because the expected response is not a json but seems to be an xml based page. That could be some html output indicating some error for the processing has been done.

    So, eventually that is an error page, which has some html code written and that's contains < at position 0, which is <!doctype ...>.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案