项目中使用案例: 父窗体 <s:form namespace="/forexagent" id="listSearchForm" name="theForm"    theme="simple" action="listAgentParametersChangeRecord?funcode=011002005"> ...... <s:textfield cssClass="px1…
最近一个项目使用到的.在网上查了好久,有的可行,有的就不行.总结一下吧.方案一:父页面:window.showModalDialog('User.jsf?USERCODE='001'&Rnd='+Math.random(),window,'dialogHeight =800px;dialogWidth=800px;dialogLeft=200px;dialogTop=100px;center=yes;scroll=yes;status=no')子页面:在要刷新父页面的时候,在Javascript…
function Closepage() { if (window.opener && !window.opener.closed) { window.parent.opener.location.reload(); } window.close(); return false; } 其它方法可借鉴: window.opener用法 http://www.cnblogs.com/zhangzt/archive/2009/12/24/1631253.html window.opener 实际…
一.js完整代码如下: //js打开新窗口 functionopenWin() {window.open('addInfo.jsp', '_blank','width=300,height=400,top=200,left=400');} //刷新当前页面方法,用于回调函数refreshWin function refreshWin() { //调用刷新页面的方法,此处RefreshSocket为刷新页面对应的方法 //也就是说,如果页面有个刷新按钮, //则点击按钮提交的类名就是此处的类名 w…
如题 function openWin(url,text,winInfo){ var winObj = window.open(url,text,winInfo); var loop = setInterval(function() { if(winObj.closed) { clearInterval(loop); //alert('closed'); parent.location.reload(); //window.location.reload(); 刷新当前页面 } }, 1); }…
<!-- 父页面 --> <!DOCTYPE html PUBLIC "-/W3C/DTD HTML 4.01 Transitional/EN" "http:/www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8&q…
//打开子页面 var url=children_url;window.open(url) //刷新parent页面 var url=parent_urlfunction refresh(url){    if(window.opener){        if(window.opener.reload){            try{                window.opener.reload();            }catch(e){}        }        w…
function JsMod(htmlurl,tmpWidth,tmpHeight){ htmlurl=getRandomUrl(htmlurl); var winObj = window.open(htmlurl, "newwindow", "height="+tmpHeight+",width="+tmpWidth); var loop = setInterval(function() { if(winObj.closed) { clearI…
function test(){ var winObj = window.open(URL); var loop = setInterval(function(){ if(winObj.closed){ clearInterval(loop); parent.location.reload(); } },1); }…
做WEB前端开发的过程中,经常会有这样的需求,用户点击[编辑]按钮,弹出一个对话框,在里边修改相应的值,然后把修改后的值显示在原页面,最后点击保存. 用window.parent.document.getElementById().setAttribute("value","")可以很好的解决这个问题. 源代码如下: 父页面中的代码: <!doctype html> <html lang="en"> <head>…
今天总结一下js中几个对象的区别和用法: 首先来说说 parent.window与top.window的用法 "window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一层页面跳转 "top.location.href"是最外层的页面跳转 举例说明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如…
<iframe>标签是很常用的,嵌在页面之中,可以做独立的加载和刷新.比如说,页面分左右或者上下结构,一般左侧和上侧是导航部分,右侧和下侧是目标页面的展示部分,只需要设置导航链接的target属性等于右侧iframe的name属性即可. 有一个需求,当session超时之后,无论点击任何的链接,都要使整个页面跳转至登陆页面. 以前未接触框架的时候,一般使用过滤器Filter来实现,过滤所有的url,当然对于登陆和退出的url不进行拦截,如果session不存在就重定向至登陆页. 接触strut…
window.showModalDialog刷新父窗口和本窗口的方法及注意:   一.刷新父窗口的方法:    A.使用window.returnValue给父窗口传值,然后根据值判断是否刷新. 在window.showModalDialog窗口页面中用window.returnValue方式设置返回值:       比如:window.returnValue='refresh';         B.在写window.showModalDialog弹出窗口函数时,定义个变量,然后根据变量值进行…
项目中发现要在iframe的弹框中获取父页面中的元素,我们可以按照如下代码操作:$(window.parent.document).find('selector').attr('XXX') 如果我们需要获取父页面的window对象,我们可以使用如下代码操作:window.parent.location.hash 如果我们获取的是最顶层的页面,那么我么可以通过window.top来实现:…
当我们在父页面使用 fancybox 弹出窗口后,如果想自己手动关闭,则可以 function Cancel() { parent.$.fancybox.close(); } 如果关闭没有反应,最好看看父页面里面有没有设置type为iframe模式   $(function () { $("#various3").fancybox({ onStart: function () { var examId = $('input[name="examRadio"]:che…
window.parent针对iframe,window.opener针对window.open 父页面parent.jsp: <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//E…
来自CSDN的问答: window.opener是什么啊? ++++++++++++++++++++++++++++++++++++++++++++++++++ 弹出本窗体的句柄 比如你想点一个按钮直接把该窗体关闭,但又不想弹出提示确认,问你是否要关闭. 可以如下写:window.opener=null;windows.close(); ++++++++++++++++++++++++++++++++++++++++++++++++++ 是在子网页中表示父网页.. 如由a网页打开b网页,则在b中…
window.parent 是iframe页面调用父页面对象 举例: a.html 如果我们需要在b.html中要对a.html中的username文本框赋值(就如很多上传功能,上传功能页在ifrmae中,上传成功后把上传后的路径放入父页面的文本框中), 我们应该在b.html中写: var _parentWin = window.parent;_parentWin.form1.username.value = "xxxx"; window.opener 是 window.open 打…
有这样一个需求,弹出一个新窗口 并从该新页面的select选择框中选择需要的类别,再返回到之前的父窗口页面的某个文本框中.这里就要用到window.parent和window.opener 如题两种方法都是javascript调用父窗口的方法. 1.window.parent是iframe页面调用父窗口对象 比如:parent.jsp 里面有一个文本框 <input id="username" value=""> <iframe scrolling…
今天在火狐浏览器上碰到个bug,调用parent.location.reload()时只刷新子页面,没有整个浏览器刷新,谷歌上没有问题,网上搜了一下 改成parent.location.reload(true)就可以了. 顺便再网上搜集了一些资料: window.location.reload()刷新当前页面. parent.location.reload()刷新父亲对象(用于框架)opener.location.reload()刷新父窗口对象(用于单开窗口)top.location.reloa…
偶尔看到了document.referrer,之前一直有点疑惑与window.opener 和 window.parent之间的区别 首先查了一下w3cSCHOOL, 上面的解释:referrer 属性可返回载入当前文档的文档的 URL. 但是解释中没有写怎么载入才能用referrer, 翻看了几篇文章,终于搞懂了. window.opener是当前页面A通过open方法弹出一个窗口B,那在B页面上 window.opener就是A window.parent是当前页面C通过location.h…
window.parent ,window.top,window.self 详解 在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口, opener是用open方法打开当前窗口的那个窗口. window.self 功能:是对当前窗口自身的引用.它和window属性是等价的. 语法:window.self 注:window.self.window.self是等价的. window.…
下面一段代码是关于window.parent和window.opener区别 来讲的,我们如果要用到iframe的值传到另一框架就要用到window.opener.document.getElementById(name).value = uvalue;这种形式哦.   window.parent能获取一个框架的父窗口或父框架.顶层窗口的parent引用的是它本身. 可以用这一点特性来判断这个窗口是否是顶层窗口.如: Code function IsTopWindow( win ) { if(…
Js 对象 window top parentWindow 当前html 页面Parent 当前html 页面的父页面Top 当前html页面的祖页面Window ==parent = top 当前页面只有一层Parent == window.parent 当前页面是子页面Top =window.parent.parent 当前页面是孙子页面 opener 属性, 被打开页面访问打开它的页面.…
在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口,opener是用open方法打开当前窗口的那个窗口. window.self 功能:是对当前窗口自身的引用,它和window属性是等价的. 语法:window.self 备注:window.self.window.self是等价的. window.top 功能:返回顶层窗口,即浏览器窗口. 语法:window.top 备注:如果…
在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口, opener是用open方法打开当前窗口的那个窗口. window.self 功能:是对当前窗口自身的引用.它和window属性是等价的. 语法:window.self 注:window.self.window.self是等价的. window.top 功能:返回顶层窗口,即浏览器窗口. 语法:window.top 注:如果窗…
在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口, opener是用open方法打开当前窗口的那个窗口. window.self 功能:是对当前窗口自身的引用.它和window属性是等价的. 语法:window.self 注:window.self.window.self是等价的. window.top 功能:返回顶层窗口,即浏览器窗口. 语法:window.top 注:如果窗…
在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口, opener是用open方法打开当前窗口的那个窗口. window.self 功能:是对当前窗口自身的引用.它和window属性是等价的. 语法:window.self 注:window.self.window.self是等价的. window.top 功能:返回顶层窗口,即浏览器窗口. 语法:window.top 注:如果窗…
今天总结一下js中几个对象的区别和用法: 1.首先来说说 parent.window与top.window的用法 "window.location.href","location.href" 是本页面跳转 "parent.location.href" 是上一层页面跳转 "top.location.href" 是最外层的页面跳转 举例说明: 如果A,B,C,D都是窗口,D是C的iframe,C是B的iframe,B是A的ifra…
在应用有frameset或者iframe的页面时,parent是父窗口,top是最顶级父窗口(有的窗口中套了好几层frameset或者iframe),self是当前窗口, opener是用open方法打开当前窗口的那个窗口. window.self 功能:是对当前窗口自身的引用.它和window属性是等价的. 语法:window.self 注:window.self.window.self是等价的. window.top 功能:返回顶层窗口,即浏览器窗口. 语法:window.top 注:如果窗…