国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

谷歌showModalDialog()方法不兼容出現對話窗口的解決辦法

2019-11-20 10:35:49
字體:
來源:轉載
供稿:網友

showModalDialog,在測試中,IE,Firefox中正常運行,但是在google中,點擊后沒什么反應,在網上看了一下,谷歌瀏覽器不支持showModalDialog模態對話框和無法返回returnValue,得到了一個解決辦法

<script type="text/javascript">//開啟模式窗口function showMyModal() {var url = "SelectUser.aspx";//傳入參數示例var modalReturnValue = myShowModalDialog(url, window, 300, 500);//alert(modalReturnValue.name);//窗口關閉后執行某些方法//TODO sth}//彈出框google Chrome執行的是openfunction myShowModalDialog(url, args, width, height) {var tempReturnValue;if (navigator.userAgent.indexOf("Chrome") > 0) {var paramsChrome = 'height=' + height + ', width=' + width + ', top=' + (((window.screen.height - height) / 2) - 50) +',left=' + ((window.screen.width - width) / 2) + ',toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no';window.open(url, "newwindow", paramsChrome);}else {var params = 'dialogWidth:' + width + 'px;dialogHeight:' + height + 'px;status:no;dialogLeft:'+ ((window.screen.width - width) / 2) + 'px;dialogTop:' + (((window.screen.height - height) / 2) - 50) + 'px;';tempReturnValue = window.showModalDialog(url, args, params);}return tempReturnValue;}</script> 

最后想要點擊就可以出現對話框就行,只需要使用onclick事件進行調用方法就行

以上給大家介紹了谷歌showModalDialog()方法不兼容出現對話窗口的問題分析及解決辦法,希望對大家有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 安康市| 广安市| 同仁县| 阜新市| 望都县| 邛崃市| 花莲市| 蒙城县| 海丰县| 灵武市| 涡阳县| 曲阳县| 逊克县| 房产| 贞丰县| 马关县| 金门县| 无极县| 民勤县| 顺昌县| 聂拉木县| 鱼台县| 微山县| 襄樊市| 塔河县| 成武县| 柳江县| 石屏县| 拉孜县| 遂溪县| 封开县| 开鲁县| 板桥市| 安新县| 江津市| 怀仁县| 滨海县| 兴义市| 澄迈县| 西充县| 郑州市|