1. 程式人生 > >Uncaught TypeError: window.showModalDialog is not a function 谷歌

Uncaught TypeError: window.showModalDialog is not a function 谷歌

sop fun replace 原創文章 aso csdn 版權 使用 parent

//新版本谷歌沒有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未定義的時候
---------------------
作者:rendeyishi
來源:CSDN
原文:https://blog.csdn.net/rendeyishi/article/details/53892611?utm_source=copy
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!

Uncaught TypeError: window.showModalDialog is not a function 谷歌