Chrome showModalDialog undefined is not a function 的替代方案
来源:互联网 发布:搜狗高速浏览器mac版 编辑:程序博客网 时间:2024/05/21 09:32
function myShowModalDialog(url, width, height, fn) { if (navigator.userAgent.indexOf("Chrome") > 0) { window.returnCallBackValue354865588 = fn; 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;'; var tempReturnValue = window.showModalDialog(url, "", params); fn.call(window, tempReturnValue); }}function myReturnValue(value) { if (navigator.userAgent.indexOf("Chrome") > 0) { window.opener.returnCallBackValue354865588.call(window.opener, value); } else { window.returnValue = value; }}
以上代码保存到公用JS文件中 页面引用
父窗体调用方法
myShowModalDialog(
"Channel-Operation-"
+ $(
this
).attr(
"data-id"
), 500, 300,
function
(v) {
if
(v == 1) {
loadList();
}
});
子窗体传值方法
myReturnValue(1);
window.close();
阅读全文
0 0
- Chrome showModalDialog undefined is not a function 的替代方案
- window.showmodaldialog undefined is not a function
- undefined is not a function
- window.showModalDialog 在谷歌Uncaught TypeError: undefined is not a function
- window.showmodaldialog is not a function
- Uncaught TypeError: window.showModalDialog is not a function chrome 谷歌浏览器
- ucUncaught TypeError: window.showModalDialog is not a function关于showModalDialog停用的问题
- Uncaught TypeError: undefined is not a function
- JS-”Undefined is not a function“错误
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: undefined is not a function
- ajaxSubmit--->undefined is not a function
- undefined is not a function错误解决
- TYPEERROR: UNDEFINED IS NOT A FUNCTION解决方法
- TypeError:undefined is not a function
- Uncaught TypeError: window.showModalDialog is not a function 谷歌
- Uncaught TypeError: window.showModalDialog is not a function 谷歌
- Uncaught TypeError: window.showModalDialog is not a function
- DOS命令大全
- Python2.7 标准库 optparse 强大的命令行参数解析器
- C# 如何在Word文档中插入艺术字
- log4j.properties 详解与配置步骤
- Android——Timer停不下来的解决方法
- Chrome showModalDialog undefined is not a function 的替代方案
- java.lang.Integer.parseInt(Unknown Source)
- HDU 2846 Repository
- HDU 6058 Kanade's sum(链表)
- Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
- LeetCode 64 Minimum Path Sum(Python详解及代码实现)
- oracle中游标详细用法
- 淘淘项目1
- Linux设备驱动模型概述