我有一个ajax函数,它在等待打印机时至少需要执行2-3分钟,但是由于这种缓慢的输出chrome显示页面无响应警报。如何使用javascript或vb函数避免出现此警告框?
我尝试设置间隔,超时和xhr事件侦听器以获取进度,但是它们都不起作用。
$.ajax({
type: "POST",
url: URL,
data: JSON.stringify(Content),
contentType: "application/json; charset=utf-8",
async: false,
datatype: 'json',
cache: false,
success: function (response) {
if (response.d.toLowerCase() == "true") {
alert("Print completed successfully!");
}
else if (response.d.toLowerCase() == "false") {
alert("Problem occured while printing copies. Kindly check your printer settings or try again later.");
}
else
alert(response.d)
location.reload();
panel.hide();
win.hide();
win.destroy();
},
error: function (response) {
alert(response);
panel.hide();
location.reload();
}
});