posts - 27,comments - 2,trackbacks - 0
<!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>提示离开当前页面的js代码</h1>
<a href="http://www.baidu.com">百度链接</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 魏文甫 阅读(237) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: