search

Home  >  Q&A  >  body text

javascript - Why does this JSONP cross-domain request fail?

I use Douban’s API.

The following is the error report.

You can see the returned data in the error URL.

I don’t understand why it failed. It’s my first time to use jsonp and ask Dalao for advice

曾经蜡笔没有小新曾经蜡笔没有小新2828 days ago788

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-06-28 09:25:15

    alert('error');
    There is a semicolon missing

    Then are you sure that the jsonp format returned by the page you requested meets the standard?

    You should visit this address:
    https://api.douban.com/v2/boo...

    Change in the code:
    jsonp:"callback",
    jsonpCallback:"jsonp",

    Supplement:
    Sorry for the complicated thinking, just change this line
    jsonp:"callback",

    reply
    0
  • Cancelreply