I have this code:
function httpGetAsync(theUrl, callback)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
}
xmlHttp.open("GET", theUrl, true); // true for asynchronous
xmlHttp.send(null);
}
httpGetAsync("http://myserver.com/test.php/?u=test&p=testtest");
when I try to run it on Firefox's console, I get:
NetworkError: A network error occurred.
Why does this happen? How can I fix this?