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

后端 未结 2 410
闹比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:13

    Because this feed returns JSON, not a javascript function call:

    [{Query172031345640518702567_1334079878875({...
    

    But it should be:

    Query172031345640518702567_1334079878875({...
    

    I don't know if this service is under your control and you can changed it, or you just need to add some params to the URL (check the manual).

    Also the content type of the response should be application/javascript, not text/json.

提交回复
热议问题