适用于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.
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 ...>
.