【发布时间】:2017-07-28 03:26:14
【问题描述】:
这是我的 jquery 代码
$('.input').keyup(function(event){
update_text(); // $('div').html('blahblah');
})
.blur(function(event){
$(this).keyup();
if(confirm('Are you sure?')){
// do somthing...
}
});
我的问题是输入模糊时,确认框应该在执行 update_text() 后显示;
但 update_text() 似乎在确认后运行...
如何让它先做update_text(),然后显示确认对话框?
【问题讨论】:
-
是
update_text()在confirm()之后运行,还是update_text()对页面所做的任何更改直到confirm()之后才重新绘制? -
似乎
update_text在confirm之前运行。但是.html()和.val()在confirm之后重绘。 =D
标签: javascript jquery dialog confirm