Can I make a jQuery JSONP request without adding the '?callback=' parameter in URL?

后端 未结 3 474
时光取名叫无心
时光取名叫无心 2020-12-10 15:39

The server won\'t accept any parameters in a request URL, so I need to remove all the extra parameters in the URL and of course I can\'t control the server.

jQuery:<

3条回答
  •  有刺的猬
    2020-12-10 16:02

    JSONP requires a callback as part of the URL. I would guess based on the description that the server you are accessing does not support JSONP.

    jQuery adds a script tag to your document, which when added runs the API request, the response calls the callback function in your code (this is simplifying it).

    You can take a look at Wikipedia if you want a more accurate description. http://en.wikipedia.org/wiki/JSONP#How_it_works

提交回复
热议问题