ucUncaught TypeError: window.showModalDialog is not a function关于showModalDialog停用的问题

ucUncaught TypeError: window.showModalDialog is not a function关于showModalDialog停用的问题


function openWin(f, n, w, h, s) 
{
	 //测试值得传入
	 alert("测试"+f+" "+n+"  "+w+"  "+h+" "+s);
	// var result=window.showModalDialog(f,n,"dialogHeight:"+h+";dialogWidth:"+w+";"+s);
     var result=window.open(f,n,"dialogHeight:"+h+";dialogWidth:"+w+";"+s);
    if(result==true)
    {
    	window.location.reload(true);
    }
    else
    {
    	//window.location.reload(true);
    }
    
}
在前台中
var result=window.showModalDialog(f,n,"dialogHeight:"+h+";dialogWidth:"+w+";"+s);



后台的值也传进来了,为什么会出现window.showModalDialog is not a function  


一个onclick一直无响应,后台的数据发现也传过去了,在前台出现这个window.showModalDialog is not a function,

不可能啊,怎么没发现呢,函数也没写错啊,结果查了查,原来在chorme 37以后,谷歌就已经把这个函数停用了,

把停用的showModalDialog改成window.open就可以打开子窗体了,应该说好多旧方法都在摒弃。。。

如果发发现js有不对的地方,打开浏览器多多按F10,进行js调试跟踪。



改成open就可以完美解决

function openWin(f, n, w, h, s) 
{
	 //测试值得传入
	 alert("测试"+f+" "+n+"  "+w+"  "+h+" "+s);
	// var result=window.showModalDialog(f,n,"dialogHeight:"+h+";dialogWidth:"+w+";"+s);
     var result=window.open(f,n,"dialogHeight:"+h+";dialogWidth:"+w+";"+s);
    if(result==true)
    {
    	window.location.reload(true);
    }
    else
    {
    	//window.location.reload(true);
    }
    
}


  • 12
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值