I want to use data from a service provided on another server. I have link to the XML and when i paste the link in my browser. I then get the XML in my browser.
In my page I use the XMLHttpRequest function to call this XML. When i save the XML on my own server as file.xml it works just fine in my webpage.
I use this function:
xmlhttp.open("GET", "file.xml", false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
But when i inserts the link to the external server i get this error:
XMLHttpRequest cannot load http://source.com/XmlFeed.asp?. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mypage.com' is therefore not allowed access.
I have searched the net and understands that this is a blocking so the service is not overloaded.
The provider of the service encurage that users caches the data so there server isnt overloaded. This means that they wont me to make a copy of the XML on my server and update this scheduled?
How can I solve my problem? Is there a problem in my code or how can i update the xml-file on my server with the xml om the provider server?