我有自定义确认框....当我按下注销时,显示框...如果按下取消,框关闭,控件保持在同一页面...按下是时,必须进行注销。 ...对我来说,取消工作正常...但是当用户按下“是”时,没有响应...。谁能帮助我...提前谢谢...
我的代码:
<s:a href="logout" cssClass="planTabHeader" id="logoutId"> <img src="../../KY/images/common/header/lock.png" alt="logout" style="border: none;background-color: transparent;" /> Log out</s:a>
javascript:
<script type = "text/javascript" >
$(document).ready(function () {
$($('#logoutId')).click(function (event) {
var msg = "";
var buttons = {};
msg = "Are you sure you want to logout?";
buttons["Yes"] = doLogout;
buttons["Cancel"] = closeDialog;
if (msg != "") {
showDialog(buttons, "cancelConfirm", msg, "dialogNormal",
"Confirmation", 470);
}
return false;
});
});
function doLogout() {
document.getElementById("logoutId").href = "logout";
}
function closeDialog() {
/* alert("action is closeDialog"); */
$("#cancelConfirm").dialog("close");
$("#cancelConfirm").dialog("destroy");
}
</script>