var xml = null;
xml = new XMLHttpRequest();
xml.open("get", who, false);
xml.send(null);
if ((xml.status >= 200 && xml.status <= 300) || xml.status == 304) {
var hi = xml.responseText;
} else {
alert("No Internet Connection! You will have to enter information by hand");
};
我想设置这个警报,如果没有互联网连接,它会这样说。但是,浏览器在 xml.send(null) 处停止/挂起,并带有 NS_ERROR_FAILURE:Failure。如何为连接正确设置测试?