请大家帮忙看下这个退弹代码,怎么才能不刷新就弹出?急用,谢谢。
时间:2010-05-15
来源:互联网
现在这个代码,每次关闭页面时弹出,但弹出时都会自动刷新一下页面,如果不关闭页面只刷新当前页也会弹出,怎么让他只在退出时弹出,刷新时不弹出呢?也就是退出时只弹出而不刷新当前页面。请高手帮忙。谢谢。有html标签权限的帮忙做个演示。谢谢。
复制内容到剪贴板
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<SCRIPT type=text/javascript>
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
function ext() //在关闭IE窗口的时候弹出
{
if(window.event.clientY<132 || altKey) iie.launchURL(popURL);
}
function brs() //插入Object
{
document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
}
var popURL = 'http://www.shishang8.com/'; //这里修改成你的退弹网址
eval("window.attachEvent('onload',brs);");
eval("window.attachEvent('onunload',ext);");
</SCRIPT>
</body>
</html>
代码:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<SCRIPT type=text/javascript>
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
function ext() //在关闭IE窗口的时候弹出
{
if(window.event.clientY<132 || altKey) iie.launchURL(popURL);
}
function brs() //插入Object
{
document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
}
var popURL = 'http://www.shishang8.com/'; //这里修改成你的退弹网址
eval("window.attachEvent('onload',brs);");
eval("window.attachEvent('onunload',ext);");
</SCRIPT>
</body>
</html>
作者: inthecitys 发布时间: 2010-05-15
你的判断不完整,用下面的方法可以知道右上角的X关闭按钮和ALT+F4,但是不能屏蔽从 文件 —> 关闭按钮
<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";}
</script>
完整代码如下:
<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";}
</script>
完整代码如下:
复制内容到剪贴板
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<SCRIPT type=text/javascript>
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
function ext() //在关闭IE窗口的时候弹出
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){ iie.launchURL(popURL); }
}
function brs() //插入Object
{
document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
}
var popURL = 'http://www.shishang8.com/'; //这里修改成你的退弹网址
eval("window.attachEvent('onload',brs);");
eval("window.attachEvent('onunload',ext);");
</SCRIPT>
</body>
</html>
代码:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<SCRIPT type=text/javascript>
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
function ext() //在关闭IE窗口的时候弹出
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){ iie.launchURL(popURL); }
}
function brs() //插入Object
{
document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
}
var popURL = 'http://www.shishang8.com/'; //这里修改成你的退弹网址
eval("window.attachEvent('onload',brs);");
eval("window.attachEvent('onunload',ext);");
</SCRIPT>
</body>
</html>
作者: cychai 发布时间: 2010-05-15
楼上这个根本就干脆不弹了,要退出弹,但是弹的时候不自动刷新页面的。
作者: inthecitys 发布时间: 2010-05-15
设计被弹出的页面强制从服务器端读取就可以
head 中
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
head 中
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
作者: shentian 发布时间: 2010-05-15
这个问题不错
退弹有办法突破IE外的浏览器么?
好像在谷歌下不行,FF下没有测试过。
退弹有办法突破IE外的浏览器么?
好像在谷歌下不行,FF下没有测试过。
作者: fjlx 发布时间: 2010-05-15
再 顶 顶
作者: inthecitys 发布时间: 2010-05-16
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28