zoukankan
html css js c++ java
javascript学习(三)——常用方法(2)
一、兼容性较高的浏览器页面关闭
//关闭网页,不支持火狐(火狐返回上次浏览页面) //FireFox非window.open()等弹出页面,需要在地址栏中输入about:config, 然后将dom.allow_script_to_close_windows改为true才能达到想要的效果。 function CloseWebPage() { if (navigator.userAgent.indexOf("MSIE") > 0) { if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { window.opener = null; window.close(); } else { window.open('', '_top'); window.top.close(); } } else if (navigator.userAgent.indexOf("Firefox") > 0) { window.history.go(-1); } else { window.close(); } }
二、window.showModalDialog()扩展
<span style="font-size:13px;">// 打开ModalDialog子窗口,并获取返回值 function ModalDialogOpen(wUrl, wWidth, wHeight) { if (window.showModalDialog != null)//IE判断 { var returnvalue = window.showModalDialog(wUrl, "_self", "dialogWidth:" + wWidth + "px;dialogHeight:" + wHeight + "px;status:no;help:no;scrolling=yes;scrollbars=yes;center=yes"); if(!returnvalue){ returnvalue = window.ReturnValue;; } return returnvalue; } else { this.returnAction = function(strResult) { if (strResult != null) return strResult; } window.open(wUrl, "", "width=" + wWidth + ",height=" + wHeight + ",menubar=no,toolbar=no,location=no,scrollbars=yes,status=no,modal=yes"); } } // 关闭ModalDialog子窗口,并返回值 function ModalDialogClose(val) { if (window.showModalDialog != null)//IE判断 { if (navigator.userAgent.indexOf("Chrome") > 0) { // Chrome支持 window.opener.ReturnValue = val; } else { parent.window.returnValue = val; } window.close(); //firefox不支持 } else { window.opener.returnAction(val); top.close(); //IE和FireFox都支持 } } </span>
javascript学习(三)——常用方法(1)
查看全文
相关阅读:
Microsoft NNI入门
【神经网络搜索】Efficient Neural Architecture Search
Sphinx 快速构建工程文档
Ubuntu16.04 Cuda11.1 Cudnn8.1 Tensorflow2.4 PyTorch1.7环境配置
【CV中的Attention机制】ShuffleAttention
【有趣的NAS】NAS-RL(ICLR2017)
分类器
将url下载到本地
缓存管理器
大数据数据结构-分类模型
原文地址:https://www.cnblogs.com/bdstjk/p/2519867.html
最新文章
Typescript学习备忘录
如何更好地调整学习率?
【神经网络架构搜索】ProxylessNAS直接在ImageNet上搜索
ICLR 2021 NAS 相关论文(包含Workshop)
CVPR2021 NAS相关论文链接
【神经网络架构搜索】SMASH直接生成候选网络权重
【Pytorch基础】Torchvision中transform的脚本化
高效管理深度学习实验
如何使用logging生成日志
Python Yaml配置工具
热门文章
自然辩证法概率小总结思维导图
【Pytorch基础】BatchNorm常识梳理与使用
【神经网络搜索】神经网络架构国内外发展现状-NAS信息检索
【神经网络搜索】Once for all
如何阅读和学习深度学习项目代码
【NAS工具箱】Pytorch中的Buffer&Parameter
【NAS工具箱】Drop Path介绍 + Dropout回顾
【神经网络架构搜索】NAS-Bench-101: 可复现神经网络搜索
【神经网络搜索】Single Path One Shot
【神经网络搜索】DARTS: Differentiable Architecture Search
Copyright © 2011-2022 走看看