1
当我点击链接'提醒'时,邮件将只弹出一次,这是正确。奇怪的是,如果我点击链接“对话框”,然后在链接“提醒”,然后消息连续弹出两次,这是不正确。奇怪的弹出行为
我该如何解决这个问题,让消息只显示一次?
HTML
<p id="test"><a href="#">alert</a></p>
<a href="#" onclick="showDialog()">dialog</a>
jQuery的
$(function() {
$("p#test a").click(function() {
alert('alert');
});
}
function showDialog(){
$("<div class='popupDialog'>Loading...</div>").dialog({
closeOnEscape: true,
height: 'auto',
modal: true,
title: 'About Ricky',
width: 'auto'
}).bind('dialogclose', function() {
jdialog.dialog('destroy');
}
谢谢!我已经用'$(document).ready'试过了,但没有成功。 – shub