onbeforeunload 如何在刷新本页面的时候不弹出对话框,而关闭本页面的时候弹出对话框啊 ?? <SCRIPT FOR=window EVENT=close > alert("欢迎你下次再来")</SCRIPT> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以判断执行onbeforeunload事件时鼠标的位置,若在X上面就alert window.onbeforeunload=function() { alert(event.clientX); alert(document.body.clientWidth); alert(event.clientY); alert(event.altKey); if(event.clientX > document.body.clientWidth && event.clientY<0 || event.altKey) { //window.event.returnValue=""; 页面提示 } //alert(window.location.href); } 为什么我的老提示 document.body.clientWidth > window.event.clientX 了?我这个代码是放在一个父的框架里面的 。。 最近收集的常用的Javscript小技巧 为什么没有效果呢 如何实现特殊页面跳转效果 怎么利用JavaScript在别的页面进行打印? VML中的这句话怎么解释? 导航栏的下拉菜单在IE6.0的版本可以正常显示,换到IE7.0的版本无法显示。 为什么我appendChild进的值没有显示在页面上 广告图片随滚动条移动 请问:怎么取得列表中的各项? 通过cookie让下拉框值在提交后保持不变的问题。 一个多选下拉列表的问题 问个关于JS的菜鸟问题
{
alert(event.clientX);
alert(document.body.clientWidth);
alert(event.clientY);
alert(event.altKey);
if(event.clientX > document.body.clientWidth && event.clientY<0 || event.altKey)
{
//window.event.returnValue=""; 页面提示
}
//alert(window.location.href);
} 为什么我的老提示 document.body.clientWidth > window.event.clientX 了?
我这个代码是放在一个父的框架里面的 。。