Why is this JSONP feed throwing “Unexpected Token” error?

后端 未结 2 445
闹比i
闹比i 2021-01-25 15:45

I\'m trying to grap this remote JSONP feed via jQuery.

Every time I try, I get an error of \"Uncaught SyntaxError: Unexpected token (\" or similar.

Am I doing

2条回答
  •  野性不改
    2021-01-25 16:09

    If you use dataType: 'jsonp' JQuery appends a callback url parameter to the request. The value of this parameter must be the function name of the callback function the server returns. As Eugene Retunsky already mentioned this is formatted incorrectly, also it seems that the server code is omitting the first character of the function name so jQuery_674... becomes Query_674... which will not work.

提交回复
热议问题