I am trying to perform a search from a web server running on a different
machine using a XmlHttpRequest. I am able to make my own page on the local
Jetty server and send & receive the request fine, but when i try to run that
page from a remote server the status is 0.
I am using Firefox 3.5 and have setup the request as below, and upon
execution i hit the alert with Status=0 & StatusText="OK".
var url =
http://server:8080/geonetwork/srv/en/main.search.embedded?any=Sydney&sortBy=relevance;
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr..withCredentials = "true";
xhr.onreadystatechange = function()
{
if ( xhr.readyState == 4 )
{
if ( xhr.status == 200 )
{
document.getElementById('divReuslts').innerHTML = xhr.responseText;
}
else
{
alert("Error retrieving data. Status: " + xhr.status + "\nText: " +
xhr.statusText);
}
}
};
xhr.send(null);
Using Wireshark i can see that i get the response packet, with the results
data and status set to 200 (OK), but my XMLHttpRequest object doesn't seem
to receive the data.
I believe i may need to add an <?access-control allow="*"?> statement
somewhere (as per http://ejohn.org/blog/cross-site-xmlhttprequest/
http://ejohn.org/blog/cross-site-xmlhttprequest/ ) but i can't figure out
where.
Any ideas?
-----
-------------------------------------------
Cuffy Camz
-------------------------------------------
--
View this message in context: http://n2.nabble.com/Cross-Site-XmlHttpRequest-tp3696567p3696567.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.