Javascript XMLHttpRequest "NetworkError" Javascript XMLHttpRequest "NetworkError" google-chrome google-chrome

Javascript XMLHttpRequest "NetworkError"


I've run into the same problem. It seems to only happen on redirect responses. If you set your async flag to false and use a callback function then the error goes away. For example:

xmlhttp.open("GET","http://google.com", false);

Then you'll need a function like this to listen for the response:

xmlhttp.onreadystatechange=function() {  if (xmlhttp.readyState==4 && xmlhttp.status==200) {    // do stuff here  }}