Uncaught TypeError: window.showModalDialog is not a function 谷歌
2016-12-27 08:47
731 查看
//新版本谷歌没有window.showModalDialog,创建一个window.open
if(window.showModalDialog == undefined){
window.showModalDialog = function(url,mixedVar,features){
window.hasOpenWindow = true;
if(mixedVar) var mixedVar = mixedVar;
if(features) var features = features.replace(/(dialog)|(px)/ig,"").replace(/;/g,',').replace(/\:/g,"=");
window.myNewWindow = window.open(url,"_blank",features);
}
}
在使用回调的时候
var parent;
//谷歌的情况下
if (window.opener != undefined) {
parent=window.opener;
}
else {
parent=window.dialogArguments;
}
只要当谷歌浏览器使用window.showModalDialog未定义的时候
if(window.showModalDialog == undefined){
window.showModalDialog = function(url,mixedVar,features){
window.hasOpenWindow = true;
if(mixedVar) var mixedVar = mixedVar;
if(features) var features = features.replace(/(dialog)|(px)/ig,"").replace(/;/g,',').replace(/\:/g,"=");
window.myNewWindow = window.open(url,"_blank",features);
}
}
在使用回调的时候
var parent;
//谷歌的情况下
if (window.opener != undefined) {
parent=window.opener;
}
else {
parent=window.dialogArguments;
}
只要当谷歌浏览器使用window.showModalDialog未定义的时候
相关文章推荐
- Uncaught TypeError: window.showModalDialog is not a function 谷歌
- Uncaught TypeError: window.showModalDialog is not a function chrome 谷歌浏览器
- Uncaught TypeError: window.showModalDialog is not a function
- ucUncaught TypeError: window.showModalDialog is not a function关于showModalDialog停用的问题
- window.showModalDialog 在谷歌Uncaught TypeError: undefined is not a function
- Uncaught TypeError: window.jsObj.closeWebView is not a function
- 报错:Uncaught TypeError: $(…).dialog is not a function,处理方法。
- 火狐下正常,谷歌、360下js中提示Uncaught TypeError: XXX is not a function
- jQuery Validation插件onfocosout/onkeyup出错的解决方法[Uncaught TypeError: undefined is not a function中文资料不好找]
- js Uncaught TypeError: undefined is not a function
- Uncaught TypeError: undefined is not a function
- Backbone 或 jQuery 出错,异常:Uncaught TypeError: object is not a function
- JS报错 Uncaught TypeError: undefined is not a function,解决
- Uncaught TypeError: object is not a function
- javascript 错误 "Uncaught TypeError: string is not a function"
- Uncaught TypeErroe: Uncaught TypeError: Cannot call method 'push' of undefined 和 Uncaught TypeError: undefined is not a function
- “Uncaught TypeError: string is not a function”
- chrome浏览器Uncaught TypeError: object is not a function问题
- uncaught typeerror, var test.match is not a function.
- Uncaught TypeError: string is not a function