local AJAX-call to remote site works in Safari but not in other browsers

后端 未结 4 960
日久生厌
日久生厌 2020-12-19 04:54

I am maintaining a website that uses Javascript. The script uses jQuery and loads some content from the server at which the site is normally hosted.

Just for conveni

4条回答
  •  天命终不由人
    2020-12-19 05:54

    Assuming the web site is domain A, and the perl script is on Domain B, you have two options: 1) Enable CORS on the web server at Domain B. http://enable-cors.org/ 2) Create a script (php, perl, ashx, etc) on Domain A that calls the script on Domain B. The script on Domain A will act as a proxy and will be allowed by all web browsers.

提交回复
热议问题