<script>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
if(confirm("确定要退出本页吗?")); {
location = "";
} else { 关闭窗口
现在的问题是点击"确定"之后,马上关闭窗口了!
}else
{
alert("你在刷新");
//return false;
}
}
</script>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
if(confirm("确定要退出本页吗?")); {
location = "";
} else { 关闭窗口
现在的问题是点击"确定"之后,马上关闭窗口了!
}else
{
alert("你在刷新");
//return false;
}
}
</script>
解决方案 »
- div高度随iframe高度改变而改变
- 我做了个网站,有首页flash的,首页是index.html,我的flash上,有一个按钮 进入网站,指向 www.xxx.com/index.php
- 求助 关于 ext 搭载 fusioncharts,加载过慢的问题
- 高手帮忙解决一下!!~~
- document.designMode 奇怪的问题
- 弄了个iframe,动态的改变其src属性,在ie5.0中无效怎么办?
- sum=0;下面在一个for循环中sum=sum+document.form1.planValue[i].value;为什么得到的sum值是把数字作字符串相连接,而不是数字相加呢?
- 有沒有給定日期,得到星期幾的函數?
- 求高人写一段js,用毛爷爷感谢
- JS页面中的值如何传到JSP编写的后天方法中去????
- 谁来推荐几个具有三级下拉菜单的网站~
- 有关判星期几的问题
您说的方法不行,我试过,点击确定后,根本不重定向到我需要的那个页面,而是直接关闭了窗口window.event.returnValue这个值好像是必须的,只有该值为否时,页面才不关闭,而直接定向到另外的一页!
function window.onbeforeunload(){
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey){
if(confirm("确定要退出本页吗?")){
} else {
event.returnValue = false
}
}else{
alert("你在刷新");
}
}
</script>
function window.onbeforeunload(){
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey){
return "强行退出将导致不良后果!"
}
}
</script>