使用 JQuery 对话框http://jqueryui.com/dialog/#modal-confirmation 该对话框在页面加载时出现我只希望它在单击“删除发票”时出现。
我试过了:<input id="RemoveInvoice" type="button" value="Remove Invoice" onclick="ConfirmDeleteInvoice()" />
然后将实际的 JS 放入 ConfirmDeleteInvoice 函数中:
function ConfirmDeleteInvoice() {
// $(function () { //removed this line and added the above line
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Are you sure you want to delete this invoice": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
}
错误:JavaScript 运行时错误:“ConfirmDeleteInvoice”未定义
抱歉还是 JS 的初学者,请多多包涵。谢谢