我在让 IE 同步运行 jscript 代码时遇到了很大的困难。其他浏览器没有问题。下面是代码示例:
function renew_order() {
$.ajaxSetup({async:false});
// These 3 lines are to disable 2 buttons and show a progress indicator. This never happens,
// which is the main problem.
$('#cancel_order_button').attr("disabled", "disabled");
$('#renew_order_button').attr("disabled", "disabled");
$('#renew_order_load').show();
// Make some Ajax call to do some processing
$.getJSON(url, function(json) {
$.each (json, function (type, name) {
new_order_id = json.OrderId;
});
});
// Close the modal box this is diaplyed on and display some results on the web page
$.modal.close();
display_new_order(order_list);
}
基本上,代码运行,模态框关闭,结果显示出来。但是模式框上的按钮在进程运行时永远不会显示为禁用。这似乎只是 IE 的问题。