你正在浏览的网页试图关闭在Internet Explorer窗口警告 [英] The webpage you are viewing is trying to close this window warning in Internet Explorer

查看:901
本文介绍了你正在浏览的网页试图关闭在Internet Explorer窗口警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录页面,如果登录sucessfull,我打开一个网页作为popup.In IE 6.0,我不遇到一个问题,但IE.7.0显示我的警告:你正在查看正在试图关闭这个网页的window.Do要关闭该窗口?当我添加codeS阻碍它,现在IE 7.0犯规给我警报,但IE浏览器6.0提供相同problem.How我能解决这个问题?

 昏暗strScript的String =< SCRIPT LANGUAGE =JavaScript的> window.open('&放大器; Class.cls_LU_PARAMETRE.Deger(START_PAGE)及','与& Now.ToString(ddMMyyyyHHmmss)及','可调整大小= 1,宽度= 1015,高度= 700,左边= 0,顶部= 0,滚动= 1,状态= 1') ;&所述; /脚本>中
Me.RegisterStartupScript(开始,strScript)

我添加此code阻碍IE 7.0警告

 昏暗参考译文]字符串
S =&下;脚本语言=的javascript>中
S + ={VAR青梅= window.self; oMe.open('','_自我',''); oMe.close();}
S + =< / SCRIPT>中,
Me.Page.RegisterStartupScript(关闭,S)************


解决方案

这是一个安全功能。毕竟,你会怎么喜欢它,如果一些网站,你去决定关闭的的浏览器窗口?

要避免这种情况的最正确的方法是打开了从JavaScript的浏览器窗口。当你这样做,父窗口允许关闭窗口而不询问用户。

i have a login page and if login is sucessfull,i open a homepage as popup.In IE 6.0,i dont come across a problem but IE.7.0 shows me an alert "The webpage you are viewing is trying to close this window.Do you want to close the window?".When i add the codes to hinder it,now IE 7.0 doesnt give me alert but IE 6.0 gives same problem.How can i solve this problem?

Dim strScript As String = "<script language= ""javascript"">window.open('" & Class.cls_LU_PARAMETRE.Deger("START_PAGE") & "','" & Now.ToString("ddMMyyyyHHmmss") & "','resizable=1,width=1015,height=700,left=0,top=0,scrollbars=1,status=1');</script>"
Me.RegisterStartupScript("start", strScript)

I add this code to hinder IE 7.0 warning

Dim s As String
s = "<script language= ""javascript"">"
s += " {var oMe = window.self;oMe.open('','_self',''); oMe.close();}"
s += " </script>"""
Me.Page.RegisterStartupScript("close", s)

'******************** 

解决方案

It's a security feature. After all, how would you like it if some website you went to decided to close your browser window?

The most correct way to avoid this is to have opened the browser window from javascript. When you do that, the parent window is allowed to close the window without asking the user.

这篇关于你正在浏览的网页试图关闭在Internet Explorer窗口警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆