I'm using this code and it's not working:
myURL = "http://localhost/index.html";
$.ajax({
type: 'GET',
url: myURL,
success: function(data) {
console.log(data);
},
async: false
});
Or
myURL = "http://127.0.1.1/index.html";
$.ajax({
type: 'GET',
url: myURL,
success: function(data) {
console.log(data);
},
async: false
});
It works when I'm in a local webpage, but when I'm in a cross domain website (like google), I cannot ajax my file at the localhost.
Is there a way to work around this? Thank you.