I have html page that I have on local machine and I loading it into chrome, using the following path
file:///C:/Siris/webpage/index.html
Now I am trying to access the REST interface that is running on my local machine. when I try to call getREST() from my button callback I am getting the following error.
XMLHttpRequest cannot load http://localhost:9000//ogre//reasoning//capabilities. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.
I have read that is because I am trying to go across domains.what my options for fixing this? Thanks
function getREST()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML =
this.responseText;
}
};
xhttp.open("GET", "http://localhost:9000//it/it2", true);
xhttp.send();
}