我想用jquery显示确认对话框,但没有反应,当我点击链接这里是我有的代码,如果我把警报,我可以看到警报在准备好功能,但不是在点击:jquery确认对话框无所作为
$(document).ready(function() {
$("#mydialog").dialog({
autoOpen: false,
modal: true
});
});
$(".myconfirmLink").click(function(e) {
e.preventDefault();
var targetUrl = $(this).attr("href");
$("#mydialog").dialog({
buttons: {
"Yes": function() {
$(this).dialog("close"), window.location.href = targetUrl;
},
"No": function() {
$(this).dialog("close");
}
}
});
$("#mydialog").dialog("open");
});
和链接我打电话它像这样:
<div class="topToolbar">
<span> <a href="/Logout.aspx" class="myconfirmLink">Log Out</a></span>
<div id="mydialog" title="Confirmation Required">
<p> Are you sure you want to request a new pack?</p>
</div>