国产探花免费观看_亚洲丰满少妇自慰呻吟_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()方法不兼容出現對話窗口的問題分析及解決辦法,希望對大家有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武功县| 监利县| 新田县| 会泽县| 林周县| 江津市| 台东县| 洛南县| 乌苏市| 昌黎县| 红桥区| 武鸣县| 玉田县| 外汇| 阜宁县| 五常市| 大冶市| 伊川县| 晋宁县| 保康县| 芦溪县| 长白| 黑水县| 乾安县| 丰原市| 修水县| 大荔县| 凤城市| 武定县| 金门县| 郯城县| 阿克苏市| 绥化市| 社会| 仁怀市| 宝兴县| 汨罗市| 吉安市| 南涧| 嘉兴市| 西林县|