<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=GBK" />
<title></title>
</head>
<body>
<h1>提示離開當(dāng)前頁面的js代碼</h1>
<a >百度鏈接</a>
<script type="text/javascript">
if (window != top) {
top.location.href = "login.action";
} else {
if (window.Event) {
window.onbeforeunload = function(event) {
return "你是否要離開此頁面,離開此頁面信息將不被保存!";
};
} else {
window.onbeforeunload = function() {
return "你是否要離開此頁面,離開此頁面信息將不被保存!";
};
}
}
</script>
</body>
</html>
posted on 2013-07-18 15:04
魏文甫 閱讀(246)
評論(0) 編輯 收藏