0
我有下面的代码,当在html页面上点击process_2banner按钮时运行。这段代码在使用Firefox时会做什么。在使用Chrome和Internet Explorer时,会调用ajax代码,但div spinner_block不会根据代码的意图显示/隐藏。 奇怪的是它的工作原理,如果我在Chrome中打开Firebug,并把Ajax调用(在.css("display","block")
语句前后断点权,spinner_box <div>
节目,然后在Ajax调用返回后,它隐藏。为什么它可以在Firefox中使用,但不适用于Chrome或IE?
你可以看到什么是错在这里 非常感谢您 安德烈斯
$('#process_2banner').on("click",function() {
var postdata = "lead_id="+rowId; //needs to include the pidm of the user clicking the button
$('#spinner_box').css("display","block");
$('#spinner_box').html('Wait, we are processing the record..');
$('#spinner_box').css("display","block");
$.ajax({type: "POST",
url: "insert_srwordpress.php",
data:postdata,
success:function(result) {
if (result.isOk == false) {
alert('Some error occurred while writing Banner') }
else {
$('#spinner_box').hide();
}
},
async: false});
});
'async:false',没有什么好的来自Synchronous AJAX。 – Musa
你是对的,这是问题:-) – MisterWalrus