开发者

Closing Window in IE8

I have a some javascript that calls is calling for a popup (media player) to load. That works But I want the parent page to close or not even appear to have opened. This works great in Firefox.

Code is:

</head>

<body>
<script language="javascript" type="text/javascript"> 
 w开发者_C百科indow.open("radio.html","Levante_Radio_Live","width=323,height=281,scrollbars=no,menubar=no,location=no",); 
 window.close(); 
</script>  
</body>


IE8 have some problem.Try this javascript.

 window.opener.location.href=Redirect_url;
                    window.close();


Your JS is fine, but I think you are running into a security feature of IE. It alerts the user that JS is trying to close the window, and requires another "yes" dialog box click. Not sure there is a way to get around that with a main window. This works for popups because the browser knows your page opened it, so it doesn't prompt you in that case.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜