window.parent说明 window.parent能获取一个框架的父窗口或父框架。顶层窗口的parent引用的是它本身.
可以用这一点特性来判断这个窗口是否是顶层窗口。如:
if(window.parent){
//内容
}
document.frames对象可以引用iframe里的页面,也可以引用frameset里的页面.
可以这样
document.frames[0].document.getElementById('xx');
可以这样
document.frames[0].document.body.innerHTML;
如何更新父窗体的数据?
用window.parent.document.getElemnetById('form1').text2.value=123
1、
<iframe id="tabFrame" name="tabFrame" marginwidth="0"marginheight="0" scrolling="no"
src="${pageContext.request.contextPath}/xxxx.do?method=xxxx" frameBorder="0"></iframe>
<iframe id="printTabFrame" name="printTabFrame"
width="100%" height=""
marginwidth="0" marginheight="0" scrolling="no" vspace="0"
src="${pageContext.request.contextPath}/xxx.jsp" frameBorder="0");"></iframe>
如果在xxx.jsp中需要获得xxxx.do的xxxx方法调转的页面中的数据,通过
window.parent.tabFrame.document.getElementById("id").value;
如果在xxx.jsp中获得父页面的内容
window.parent.document.getElementById("printTabFrame").src;
分享到:
相关推荐
window.parent调用父框架时,ie跟火狐不兼容问题!
今天总结一下js中几个对象的区别和用法: 首先来说说 parent.window与top.window的用法 “[removed].href”、”location.href”是本页面跳转 “parent.location.href”是上一层页面跳转 “top.location.href”是最...
window.parent.方法()或者变量名 window.parent相当于定位到父页面 之后的操作和在父页面中写代码一样写 window.parent.aa();//调取aa函数 window.parent.bb;//调取bb变量 例如:想在子页面中得到id为aaa的文本框的...
window.clearInterval与window.setInterval的用法.
1> window.showModalDialog()采用JS原理实现,同时父窗口不可操作,window.open()采用新创建一个窗口,同时父窗口可操作; 2> 父窗口与子窗口传递值的方式也有所不同,在子窗口中操作父窗口也语法也不同,分别为var...
window.showModalDialog以及window.open用法简介
window.postMessage的功能是允许程序员跨域在两个窗口/frames间发送数据信息。基本上,它就像是跨域的AJAX,但不是浏览器跟服务器之间交互,而是在两个客户端之间通信。让我们来看一下window.postMessage是如何工作...
对window.open进行封装, 使其更好用, 且更兼容, 很多人说window.open不兼容,其实不是, 因为不能直接执行, 必须通过用户手动触发才行;看代码: 代码如下 var openWindow = function(url, options) { var str = ""; ...
window.parent.frames[1].location.reload(); 语句2. window.parent.frames.bottom.location.reload(); 语句3. window.parent.frames[“bottom”].location.reload(); 语句4. window.parent.frames.item(1)....
(“#父窗口元素ID”,window.parent.document); 对应javascript版本为window.parent.document.getElementByIdx_x(“父窗口元素ID”);取父窗口的元素方法:$(selector, window.parent.document);那么你取父窗口的父...
NULL 博文链接:https://shawnfree.iteye.com/blog/598885
window.hlp window.hlpwindow.hlp window.hlp window.hlp
This is a `window.showModalDialog()` shim using a modal HTML5 `<dialog>` element and ECMAScript 6 Generators. It was tested in the latest Google Chrome with the *Enable Experimental JavaScript* flag ...
window.location.href页面跳转的用法(区别于redirect)
重写window.alert方法 重写window.alert方法
window.showModalDialog以及window.open用法简介
扩展window.open方法,使得window.open时针对相同的URL地址非打开新窗口,而是仅仅激活已存在窗口,另外,此激活不会刷新页面,不会丢失页面上已存在的数据
Window.open ('page.html') 用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。用单引号和双引号都可以,只是不要混用。 这一段代码...
window.request window.fetch 的别名将window.fetch别名为window.request “大脑 polyfill”。 老实说, 听起来不太 。 “Fetch”听起来就像您只是在执行GET请求。 我们习惯于谈论请求和响应。 的实际上说了 9 次...