这是我的代码:
$("#success").dialog({
modal: true,
title: 'Payment success',
width: 400,
});
如何在此对话框中显示OK
按钮?
答案 0 :(得分:13)
使用Buttons option并查看Modal Message。
$("#success").dialog({
modal:true,
title:'Payment success',
width:400,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
答案 1 :(得分:2)
$("#success").dialog({modal:true,title:'Payment success',width:400,buttons{"Ok":execute,"Cancel": cancel}});
var execute = function()
{
alert('This is Ok button');
}
var cancel = function()
{
alert('This is Cancel button');
}
这应该有效。
答案 2 :(得分:1)
$("#success").dialog({
modal:true,
title:'Payment success',
width:400,
buttons: {
Ok: function() {
$(this).dialog('close');
}
});
当您单击对话框将关闭的按钮时,应该添加一个文本为“Ok”的按钮:)