日期:2014-05-16  浏览次数:20299 次

怎样用脚本关闭窗口而不弹出提示
用以下代码关闭窗口时,会弹出提示,怎样才能不弹出提示?
  该页面是由另一个页面用Response.Redirect语句转过来的
<script   language= "javascript ">
function   Initial()
{
window.print();
                  window.opener=null;
window.close();
}
</script>


<body     onload= "initial() ">
    ...
</body>

------解决方案--------------------
function Close()
{
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()
}
}
------解决方案--------------------
window.opener= "hello ";
window.close();

刚看到的,哈哈
------解决方案--------------------
up


------解决方案--------------------
这与你的操作系统有关,98的会弹,XP不会弹,我曾经在这个上面花了好些工夫的.