第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

chrome 沒有showModalDialog方法怎么辦

chrome 沒有showModalDialog方法怎么辦

拉丁的傳說 2018-11-21 18:15:27
在訪問一些路由器設(shè)置頁面的時候,由于比較老,chrome竟然無法正常彈出設(shè)置窗口,console里報錯:showModalDialog方法不存在
查看完整描述

1 回答

?
慕標琳琳

TA貢獻1830條經(jīng)驗 獲得超9個贊

直接把對應(yīng)的showModalDialog方法改成open就可以了

另stackoverflow上的代碼,但是有時候不起作用

<script type="text/javascript">

  // fix for deprecated method in Chrome 37

  if (!window.showModalDialog) {

     window.showModalDialog = function (arg1, arg2, arg3) {


        var w;

        var h;

        var resizable = "no";

        var scroll = "no";

        var status = "no";


        // get the modal specs

        var mdattrs = arg3.split(";");

        for (i = 0; i < mdattrs.length; i++) {

           var mdattr = mdattrs[i].split(":");


           var n = mdattr[0];

           var v = mdattr[1];

           if (n) { n = n.trim().toLowerCase(); }

           if (v) { v = v.trim().toLowerCase(); }


           if (n == "dialogheight") {

              h = v.replace("px", "");

           } else if (n == "dialogwidth") {

              w = v.replace("px", "");

           } else if (n == "resizable") {

              resizable = v;

           } else if (n == "scroll") {

              scroll = v;

           } else if (n == "status") {

              status = v;

           }

        }


        var left = window.screenX + (window.outerWidth / 2) - (w / 2);

        var top = window.screenY + (window.outerHeight / 2) - (h / 2);

        var targetWin = window.open(arg1, arg1, 'toolbar=no, location=no, directories=no, status=' + status + ', menubar=no, scrollbars=' + scroll + ', resizable=' + resizable + ', copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);

        targetWin.focus();

     };

  }

</script>


查看完整回答
反對 回復 2018-12-29
  • 1 回答
  • 0 關(guān)注
  • 570 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號