JS版常见问题(二)兼容版本的无提示关闭窗口!
2003-12-19 23:20
633 查看
<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()">
</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()">
</body>
</html>
相关文章推荐
- JS版常见问题(二)兼容版本的无提示关闭窗口!
- 兼容版本的无提示关闭窗口(JavaScript)!
- js窗口关闭提示信息(兼容IE和firefox)
- JS判断用户是否有权限进入当前页面,没有直接关闭(解决IE7以上版本提示问题)
- js窗口关闭提示信息(兼容IE和firefox)
- js关闭窗口时老提示的问题
- js直接关闭窗口不提示
- 求解决js打开关闭框架不能兼容ff的问题
- Node.js express 版本出现的几个常见问题
- JavaScript无提示关闭窗口(兼容IE/Firefox/Chrome)
- IE6-7 JS关闭窗口不提示的方法
- js修改input的type属性问题(兼容所有浏览器,主要用于密码类的默认有提示文字的效果)
- IE/Firefox中JS脚本常见兼容问题
- bootstrap-datetimepicker.js的兼容性问题(IE10兼容模式无法弹出窗口)
- 兼容IE8以下浏览器input表单属性placeholder不能智能提示功能,以及使用jquery.validate.js表单验证插件的问题处理
- window.showModalDialog方式/模式窗口数据不刷新(缓存)问题/模式窗口中,链接弹出新窗口问题/无提示关闭页面的方法
- IE6-7 JS关闭窗口不提示的方法
- JavaScript无提示关闭当前页面窗口,兼容IE/Firefox/Chrome (Close the current page window without confirm by JavaScript, support all browsers)
- JS关闭窗口时不提示“是否要关闭本窗口”
- JavaScript技巧——js关闭窗口无提示