What i want to know is, that can i send a get request with ajax for instance to stackoverflow.com with ajax and get the response, like for example:
Sending a Get request to stackoverflow with Node JS.
const https = require("https");
https.get("https://stackoverflow.com", res => {
res.on("data", data => {
console.log(data.toString());
})
})
I got all the Html code in the response.
Now if i try to send the same requests but through AJAX.
$.getJSON("https://stackoverflow.com", response => {
console.log(response);
});
I end up with this error:
XMLHttpRequest cannot load https://stackoverflow.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource.