解决弹出的窗口window.open会被浏览器阻止的问题
来源:互联网 发布:拼多多是什么软件 编辑:程序博客网 时间:2024/05/23 00:46
遇到自动跳转时要弹出网页,就发现出现了问题。后发现有这样的情况:
//这样注册的脚本会被阻止: System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "js", "window.open('http://www.xxxxxxxxx.com');", true);
//客户端由用户触发的不会被阻止,即使设置阻止程序.obj.onclick=window.open("http://www.xxxxxxxxx.com")
1、放到连接里,然后用JS伪协议打开就好了
<a href='javascript:void window.open("x.html","x","resizable,width=600,height=450")'>不会被阻止</a>
2、登录窗口前一页Login0.aspx页面添加如下代码,
<a href="javascript:void window.open('Login.aspx','','width=1014px,height=703px,scrollbars=yes,left=0,top=0')">汽车租赁管理系统</a>
3、代码页添加
Response.Write("<script language='javascript'>window.open('Login.aspx','_self','')</script>");
4、在登录成功后
Response.Write("<script language='javascript'>window.open('Default.aspx','_blank','width=1014px,height=703px,scrollbars=yes,left=0,top=0');window.close();</script>");
5、
function openwin(url) { var a = document.createElement("a"); a.setAttribute("href", url); a.setAttribute("target", "_blank"); a.setAttribute("id", "openwin"); document.body.appendChild(a); a.click();}
<input type="button" id="btn" value="百度" onclick="openwin('http://www.baidu.com');" />
来自:http://www.cnblogs.com/linyechengwei/archive/2011/03/23/1992434.html
http://blog.csdn.net/daqiaonanlu2000/article/details/3721512
- 解决弹出的窗口window.open会被浏览器阻止的问题(自定义open方法)
- 解决弹出的窗口window.open会被浏览器阻止的问题
- 解决弹出的窗口window.open会被浏览器阻止的问题
- 解决弹出的窗口window.open会被浏览器阻止的问题
- 解决弹出的窗口window.open会被chrome浏览器阻止的问题
- 解决window.open弹出的窗口被阻止情况
- 弹出窗口window.open被浏览器阻止
- 解决window.open 会被IE阻止的问题
- window.open 会被IE阻止的问题
- window.open 会被IE阻止的问题
- javascript 解决window.open 被IE弹出窗口阻止程序拦截
- js解决window.open 被IE弹出窗口阻止程序拦截
- 解决window.open被浏览器拦截的问题
- 如何防止window.open打开的弹出窗口被浏览器拦截
- 关于window.open弹出窗口有无标题栏的问题
- 怎么弹出一个既不会被拦截,又是window.open方式实现的最大化弹出窗口?
- 弹出窗口window.open()的参数列表
- window.open的弹出窗口居中
- 滤波电容的选择
- 量子物理史话 第三章 火流星
- windows 7 下让 Delphi 2010 开发的程序具备UAC管理员权限
- Adding SOAP headers【转】
- c#多线实例
- 解决弹出的窗口window.open会被浏览器阻止的问题
- Ubuntu 10.04 下pdf显示乱码的解决方法
- php函数前面加&符号的意思是函数的引用
- 网络协议的三要素
- 资治通鉴,卷八十五,晋惠帝也有明白的时候
- 黑马程序员—学习笔记之SQL数据分组、限制结果集行数
- fatjar导出的jar文件双击执行时提示could not find the main class
- sql cookbook 数据库脚本 for db2
- 千兆网动态配置FPGA小结(1)