Cross domain browser version
See original GitHub issueNodejs:
var axios = require("axios");
axios.get("https://www.google.com.vn")
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
It work perfect ! But when i run it in browser version:
<script src="https://npmcdn.com/axios/dist/axios.min.js"></script>
<script>
axios.get("https://www.google.com.vn")
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
</script>
Error:
XMLHttpRequest cannot load https://www.google.com.vn/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
localhost/:9 Error: Network Error(…)
What i missing ? Sorry i new to axios
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Same-origin policy - Web security | MDN
Browsers block stylesheet loads if it is a cross-origin load where the MIME type is incorrect and the resource does not start with...
Read more >Cross-Origin Resource Sharing | Can I use... Support tables ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >Cross-origin resource sharing - Wikipedia
Cross -origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside...
Read more >Cross-Origin Requests (CORS) in Internet Explorer, Firefox ...
Below we describe how to enable cross-origin requests in each of 4 major browsers. In FireFox, Safari, Chrome, Edge and IE 10+. To...
Read more >Cross Domain - CORS
List of feature: - Allow cross domain - Customize Url pattern base on Javascript Regex - Allow enable, disable - Very friendly interface ......
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
I’m using jquery and it’s working just fine. But it’s still got error with axios
Yeah I am getting this issue to and it’s driving me nuts, only happening on firefox