Loading cross-domain endpoint with AJAX

前端 未结 9 1669
醉酒成梦
醉酒成梦 2020-11-21 05:20

I\'m trying to load a cross-domain HTML page using AJAX but unless the dataType is \"jsonp\" I can\'t get a response. However using jsonp the browser is expecting a script m

9条回答
  •  灰色年华
    2020-11-21 05:43

    If the external site doesn't support JSONP or CORS, your only option is to use a proxy.

    Build a script on your server that requests that content, then use jQuery ajax to hit the script on your server.

提交回复
热议问题