用window.open代替window.showModalDialog和window.showModelessDialog



window.open 一般在主页打开一个窗口,如果使用者不关闭弹出的窗口,再次点击还是会重复打开。
或者存在弹出窗口后,不会在最前端显示。下面是一个超链接弹出窗口的解决方案。
window.showModalDialog和window.showModelessDialog 除了IE支持外,其他浏览器都不支持。

<asp:HyperLink ID="test" ForeColor="#1E71B5" runat="server"
                       NavigateUrl="javascript: var win;  var arg=document.getElementById('MainContent_dmc').value;
                                    var argp=document.getElementById('MainContent_package_name').options[document.getElementById('MainContent_package_name').selectedIndex].value;
                             win=window.open('test.aspx?arg1='+arg+'&arg2='+argp,'web1','Height=500px,Width=300px,top=200, left=700');

 if (win && win.open && !win.closed) win.focus();">
                       test</asp:HyperLink>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值