我有一个 html 表格我希望在单击一行时出现一个对话框并且为了更新我的数据库我做了一个有点像这样的 ajax 调用:
$(document).ready(function() {
$('.myrow').click(function ()
{
$("#dialog").dialog({
autoOpen: false,
modal: true,
width: 600,
height: 300,
resizable: false,
buttons: {
"Yeah!": function() {
$(this).dialog("close");
},
"Sure, Why Not": function() {
$(this).dialog("close");
}
}
});
$.ajax({
type: "post",
url: "shownotification.jsp",
data: {
notifyidd: $(this).attr("id")
},
error : function(){
alert('Error');
},
success: function(msg){
alert('Success');
}
});
});
});
但是对话框没有出现,求助
在 html 中,我为对话框做了一个划分:
<div id="dialog"></div>
我还包含了所需的 js 和 css 文件。
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/ui-darkness/jquery-ui.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
还是没有成功,求助
最佳答案
您将自动打开标志设置为 false。尝试将其设置为 true。如果您仍想使用 false,则必须调用 .open() 方法。
关于javascript - 单击表格行的对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23312906/