window.showModalDialog()方法在Chrome下不能使用的解决方法
2013-03-22 16:24
337 查看
1、用window.open()替代其弹出窗口
2、用 getBrowserType() 判断当前浏览器是什么浏览器,并作出相应处理。
function getBrowserType() {
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/msie ([\d.]+)/))return 1;
if(ua.match(/firefox\/([\d.]+)/))return 2;
if(ua.match(/chrome\/([\\d.]+)/))return 3;
if(ua.match(/opera.([\d.]+)/))return 4;
if(ua.match(/version\\/([\d.]+).*safari/))return 5;
return 0;
}
3、IE用window.returnValue 向父窗口传递参数;
Chrome用window.opener.returnValue向父窗口传递参数,并且调用 window.opener.document.all.btnGetList.click();局部舒心父窗口。
4、在父窗口定义一个控件<input type="hidden" id="btnGetList" onclick="<%=PostBack()%>" />
5、在父窗口的后台定义PostBack()方法
protected string PostBack()
{
return this.Page.GetPostBackEventReference(this.hidAdd, "getList");
}
hidAdd触发下面事件
protected void btnAdd_Click(object sender, EventArgs e)
{
this.GetList();
}
2、用 getBrowserType() 判断当前浏览器是什么浏览器,并作出相应处理。
function getBrowserType() {
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/msie ([\d.]+)/))return 1;
if(ua.match(/firefox\/([\d.]+)/))return 2;
if(ua.match(/chrome\/([\\d.]+)/))return 3;
if(ua.match(/opera.([\d.]+)/))return 4;
if(ua.match(/version\\/([\d.]+).*safari/))return 5;
return 0;
}
3、IE用window.returnValue 向父窗口传递参数;
Chrome用window.opener.returnValue向父窗口传递参数,并且调用 window.opener.document.all.btnGetList.click();局部舒心父窗口。
4、在父窗口定义一个控件<input type="hidden" id="btnGetList" onclick="<%=PostBack()%>" />
5、在父窗口的后台定义PostBack()方法
protected string PostBack()
{
return this.Page.GetPostBackEventReference(this.hidAdd, "getList");
}
hidAdd触发下面事件
protected void btnAdd_Click(object sender, EventArgs e)
{
this.GetList();
}
相关文章推荐
- window.showModalDialog()方法在Chrome下不能使用的解决方法
- JavaScript中的window.close在FireFox和Chrome上不能正常动作的解决方法
- Axure chrome 扩展显示已损坏的解决方法 写在前面的话: 之前用的好好的Axure chrome 扩展如今却并不能使用,一直说扩展已损坏,额,上网下了几个.crx文件都没有用……
- firefox开启多进程方法 以及 火狐 (firefox)不能使用 showmodaldialog 解决方法
- Chrome在某些网站可能会遇到使用flash时上传文件对话框不能弹出的情况解决方法
- firefox开启多进程方法 以及 火狐 (firefox)不能使用 showmodaldialog 解决方法
- JavaScript中的window.close在FireFox和Chrome上不能正常动作的解决方法
- 解决intellij idea中使用live edit插件不能在chrome即时显示css变化的方法(html可以)
- iOS9不能正常使用HTTP的解决方法
- 有关td使用colspan属性后导致td不能充满整个tr的问题解决方法
- android2.3平台上web页面(html5中使用frame)不能滑动的解决方法
- SQL2005不能使用sa登录的解决方法
- 使用iScroll时,input等不能输入内容的解决方法
- IE6 中 window.location.href 不能跳转 以及关于a标签点击返回顶部的解决方法
- win7中C#的winForm编程使用savefiledialog不能弹出保存窗体的解决方法
- ubuntu下使用vi是方向键变乱码 退格键不能使用的解决方法
- hql不能使用Limit的解决方法
- centos 不能使用scp命令 解决方法
- Ubuntu使用问题(一):Ubuntu不能正常关机的解决方法