完美关闭窗口无提示
2005-12-22 14:34
267 查看
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<!--
by fason(2003-5-20)
-->
</head>
<body>
<script language="JavaScript">
<!--
function CloseWin()
{
var ua=navigator.userAgent
var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
if(ie){
var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
if(IEversion< 5.5){
var str = '<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
str += '<param name="Command" value="Close"></object>';
document.body.insertAdjacentHTML("beforeEnd", str);
document.all.noTipClose.Click();
}
else{
window.opener =null;
window.close();
}
}
else{
window.close()
}
}
//-->
</script>
<input type=button value=关闭 onclick="CloseWin()">
<script language=javascript>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
window.event.returnvalue = "";
}
}
</script>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<!--
by fason(2003-5-20)
-->
</head>
<body>
<script language="JavaScript">
<!--
function CloseWin()
{
var ua=navigator.userAgent
var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
if(ie){
var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
if(IEversion< 5.5){
var str = '<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
str += '<param name="Command" value="Close"></object>';
document.body.insertAdjacentHTML("beforeEnd", str);
document.all.noTipClose.Click();
}
else{
window.opener =null;
window.close();
}
}
else{
window.close()
}
}
//-->
</script>
<input type=button value=关闭 onclick="CloseWin()">
<script language=javascript>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
window.event.returnvalue = "";
}
}
</script>
</body>
</html>
相关文章推荐
- 最完美解决方案:js弹出窗口关闭当前页面,而不弹出提示框
- 完美实现Javascript关闭窗口不提示关闭对话框的方法
- js无提示关闭浏览器窗口的两种方法分析
- javascript无提示关闭窗口
- 关闭map窗口时,提示内存泄漏
- 关闭窗口而不出现提示信息
- JS关闭窗口而不弹出提示 如何让有滚动条的层自动滚动到最下
- 窗口没有提示自动关闭的js代码
- 不提示确认而直接关闭窗口的脚本
- WinForm的技巧(1 of n)窗口关闭的提示
- WPF(MVVM)主窗口关闭时 弹窗提示是否关闭
- JavaScript无提示关闭窗口
- JS无提示关闭浏览器窗口脚本以及不同浏览器对window.close()不同表现
- JavaScript无提示关闭当前页面窗口,兼容IE/Firefox/Chrome
- winform窗口关闭提示
- js直接关闭窗口不提示ie6.0,ie7.0通用
- js直接关闭窗口不提示ie6.0,ie7.0通用
- [JavaScript]IE6、IE7、Firefox 无提示关闭窗口的代码
- 在气泡式提示窗口中显示关闭按钮 zz
- Extjs 如何在关闭窗口时提示是否关闭