// show a confirm message box to user // param title : the title to show on the message box // param msg : the confirm message to tell the user // param confirmCallback : what happens after the confirm button is clicked function msgConfirm(title, msg, confirmCallback) { var htmlMsg = "<div style='text-align:center; vertical-align: middle; display:none'>"; htmlMsg += "<p><span>" + msg + "</span></p>"; htmlMsg += "</div>"; $(htmlMsg).dialog({ title: title, modal: true, resizable: false, width: 300, height: 180, buttons: { "确定": function() { if(confirmCallback != null) { confirmCallback(); } $(this).dialog('close'); }, "取消": function() {$(this).dialog('close');} } }); }