温馨提示×

easyui window refresh 刷新两次的解决方法

小云
115
2023-08-09 16:00:37
栏目: 智能运维

刷新两次的问题可能是因为在刷新时触发了两次刷新事件。以下是解决该问题的一种方法:

  1. 在刷新事件之前,先移除原有的刷新事件监听器。
$('#window').window({
onBeforeRefresh: function(){
$(this).window('clear');
$(this).window('refresh', 'newContent.html');
$(this).window('un', 'refresh');
}
});
  1. 在刷新事件监听器中,先清空窗口内容,然后再重新刷新窗口。

这样就可以确保只有一次刷新事件。

0