Origin is not allowed by Access-Control-Allow-Origin
See original GitHub issueHi, I’m using public API method in JavaScript on my local PC. But request failed because of Single-Origin-Policy.
The code is something like this.
<html>
<head>
<meta chartset="utf-8">
<script type="text/javascript" src="https://unpkg.com/ccxt"></script>
</head>
<body>
<h1>jQuery Request</h1>
<script>
var bitflyer = new ccxt.bitflyer();
bitflyer.fetchTicker('BTC/JPY').then(function(data) {console.log(data);});
</script>
</body>
</html>
I received following error.
Origin null is not allowed by Access-Control-Allow-Origin.
How can I fix this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Origin is not allowed by Access-Control-Allow-Origin
I wrote an article on this issue a while back, Cross Domain AJAX. The easiest way to handle this if you have control...
Read more >Reason: CORS header 'Access-Control-Allow-Origin' missing
The response to the CORS request is missing the required Access-Control-Allow-Origin header, which is used to determine whether or not the ...
Read more >Fixing "No 'Access-Control-Allow-Origin' Header Present"
This error occurs when a script on your website/web app attempts to make a request to a resource that isn't configured to accept...
Read more >3 Ways to Fix the CORS Error — and How the Access- ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >Error Origin is not allowed by Access-Control-Allow-Origin
This will allow cross-domain Ajax. In PHP, you'll want to modify the response like so: <?php header('Access-Control-Allow-Origin: *') ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aiueogawa I can also suggest trying a public proxy:
If it works for you with any of these two proxies, then you still can set up a proper local proxy, just need to read more about their setup (depending on which one you choose).
@kroitor I have no more questions. Thank you for all!