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

后端 未结 17 1404
孤城傲影
孤城傲影 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:36

    For PHP - this Work for me on Chrome, safari and firefox

    https://w3c.github.io/webappsec-cors-for-developers/#avoid-returning-access-control-allow-origin-null

    header('Access-Control-Allow-Origin: null');
    

    using axios call php live services with file://

提交回复
热议问题