分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

[转] 怎样用jquery关闭子页面,并刷新父页面

发布时间:2023-09-06 01:37责任编辑:赖小花关键词:暂无标签

转自 https://zhidao.baidu.com/question/747776028293107892.html

如果是模态窗口弹出<form name="form1"><input type="text" name="fag1"><input type="text" name="fag2"></form>function shw(){var url="open.html";//----------方法一--start-------var obj=document.form1; //指定页面对象var returnValue=window.showModalDialog(url ,obj,‘dialogHeight:550px;dialogWidth:500px;center:yes‘); //方法返回值//----------方法一--end-------alert(returnValue);}如果是非模态窗口弹出,那么<script type="text/javascript">//弹出窗口function openwin(url,width,height){ var l=window.screen.width ; var w= window.screen.height; var al=(l-width)/2; var aw=(w-height)/2; var OpenWindow=window.open(url,"弹出窗口","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+width+",height="+height+",top="+aw+",left="+al+""); OpenWindow.focus();if(OpenWindow!=null){ //弹出窗口关闭事件//if(window.attachEvent) OpenWindow.attachEvent("onbeforeunload", quickOut); if(window.attachEvent) OpenWindow.attachEvent("onunload", quickOut); }}//关闭触发方法function quickOut(){alert("窗口已关闭");}</script><input type="button" value="ok" onclick="openwin(‘open.html‘,‘600‘,‘500‘)"><input type="text" name="txt0" id="txt0"> 注意:firefox这里一定要写ID属性,不然取不到值

[转] 怎样用jquery关闭子页面,并刷新父页面

原文地址:https://www.cnblogs.com/bobo1713930654/p/8303539.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved