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


//新版本谷歌沒有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
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM