我想在运行AJAX调用时将鼠标指针更改为"Wait“符号,并在完成调用后返回到默认指针。我尝试过如下操作,但我的问题是,在我不点击/按下鼠标按钮之前,它只能在Firefox上工作。下面是我的代码:
function initializeAjax(url){
$('html, body').css("cursor", "wait");
try {
if (url.substring(0,4) == ".mdf") {
var database = window.location.pathname.slice(0,window.location.pathname.lastIndexOf('.mdf'));
var url = database + url;
}
initRequest(url);
returnedValues = null;
req.onreadystatechange = returnedValues;
nocache = Math.random();
req.open("GET", url+"&nocache = "+nocache, false);
req.send(null);
$('html, body').css("cursor", "auto");
return req.responseText;
}
catch(err) {
return "Error 8";
}
}
有没有人可以帮我修改上面的代码来解决这个问题,这样它也可以在Firefox和IE中工作。
https://stackoverflow.com/questions/8805507
复制相似问题