“未捕获的SyntaxError:意外的令牌:”JSONP响应

这个问题在这里已经有了答案:

  • JSONP是否需要修改服务器? 1个答案
  • json Uncaught语法错误:意外的标记:4个答案

  • 尝试:

    function testJSONP(url) {
        $.ajax({
          url: url,
          jsonp: "callback",
          contentType: 'application/javascript',
          dataType: "jsonp",
          success: function (response) {
            console.log(response);
          }
        });
      }
    

    这样写...

    function testJSONP(url) {
        $.getJSON(url,{},function(response){
            console.log(response);
        });
    }
    
    链接地址: http://www.djcxy.com/p/46025.html

    上一篇: "Uncaught SyntaxError: Unexpected token :" JSONP response

    下一篇: API Call: Uncaught SyntaxError: Unexpected token :