“Origin null is not allowed by Access-Control-Allow-Origin” error for request made by application running from a file:// URL

后端 未结 17 1377
孤城傲影
孤城傲影 2020-11-21 04:42

I\'m developing a page that pulls images from Flickr and Panoramio via jQuery\'s AJAX support.

The Flickr side is working fine, but when I try to $.get(url, ca

17条回答
  •  囚心锁ツ
    2020-11-21 05:23

    I use Apache server, so I've used mod_proxy module. Enable modules:

    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    

    Then add:

    ProxyPass /your-proxy-url/ http://service-url:serviceport/
    

    Finally, pass proxy-url to your script.

提交回复
热议问题