I am doing a cross-site XmlHttpRequest and using Wireshark i can see the packet return with the XML data in it, but my XmlHttpRequest object gets a status code of 0 and has no responseText. (I am using Firefox 3.5 which should support cross-site requests).
on load i call
function init()
{
//Create XmlHtmlRequest object
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = processResults;
}
function performSearch()
try
{
xmlhttp.open("GET",
http://server:8080/search?text=help, true);
xmlhttp.withCredentials = "true";
xmlhttp.send(null);
}
catch (e)
{
alert("Can't connext to server:\n" + e.toString() );
}
}
function processResults()
{
if (xmlhttp.readyState == 4)
{
alert("AllResponseHeaders: " + xmlhttp.getAllResponseHeaders() );
if xmlhttp.status == 200)
{
document.getElementById('divReuslts').innerHTML = xmlhttp.responseText;
}
else
{
alert("Error! Status" + xmlhttp.status + " - " + xmlhttp.statusText);
}
}
}
I get the following error response header:
Can't connext to server:
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
http://server:8080/project/pages/search_page.seam :: performSearch :: line 132" data: no]
Any ideas why i can see the data in Wireshark but my object doesn't receive it?