0

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.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339

0 Answers0