"Uncaught SyntaxError: Unexpected token :" JSONP response

This question already has an answer here:

  • Does JSONP require server modifications? 1 answer
  • json Uncaught SyntaxError: Unexpected token : 4 answers

  • 尝试:

    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/46026.html

    上一篇: 以编程方式为跨度底部

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