建立一个如下的关系框架

windowA.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>windowA</title>
</head>
<frameset rows="160,*">
<frame src="frame.html" name="topFrame">
<frameset cols="50%,50%">
<frame src="aframe.html" name="leftFrame">
<frame src="bframe.html" name="rightFrame">
</frameset> </frameset> </html>

aframe.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h4>this is aframe.html</h4>
<script type="text/javascript">
function sayleft() {
console.log("frameA from....");
}
var age=44;
console.log(window.age)
//sayleft()
</script> </body>
</html>

bframe.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h4>this is aframe.html</h4>
<script type="text/javascript">
function sayleft() {
console.log("frameA from....");
}
var age=44;
console.log(window.age)
//sayleft()
</script> </body>
</html>

cframe.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h4>this is aframe.html</h4>
<script type="text/javascript">
function sayleft() {
console.log("frameA from....");
}
var age=44;
console.log(window.age)
//sayleft()
</script> </body>
</html>

frame.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h3>this is frame.html</h3>
<script type="text/javascript">
function sayHi() {
console.log("frameTop");
}
var age=33;
console.log(window.age)
sayHi()
</script> </body>
</html>

    console.log("调用window.opener.parent.leftFrame.sayHi()方法");
window.opener.parent.frames["leftFrame"].sayleft();
console.log(window.opener);
console.log(window.opener.parent.frames["topFrame"].age);
window.parent.leftFrame.sayleft();

跳转的页面cframe.html,通过window.opener找到原页面window属性,在通过.parent找到frame.通过frame.函数名来调用函数

重要说的是: open一个窗口,这个窗口就是独立的window了 和 其他窗口之间就没关系了,唯一的联系就是window.opener属性

frame window 和open 的关系的更多相关文章

  1. 动态加载Layout 与 论Activity、 Window、View的关系

    1)动态加载Layout的代码是 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null)); ...

  2. 图解:window与BOM的关系

    window与BOM的关系: 1.https://www.jianshu.com/p/f5409202a835

  3. android 中的 window,view,activity具体关系

    通过讨论这个问题,我们能够见识到google是对面向对象模式的理解,能够理解android底层的一些调用.这也是一道很常见的面试题. 我们这篇文章就来解决这四个问题: Android  中view的显 ...

  4. 动态载入Layout 与 论Activity、 Window、View的关系

    1)动态载入Layout的代码是 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null)); ...

  5. DirectFB、Layer、Window、Surface之间关系

    层(Layers) 表示一块儿独立的图像缓冲区.大多数的嵌入式设备都有多个层.他们由硬件使用合适的alpha值来blending,然后显示. 表面 (Surface) 用来保存像素数据的保留内存区域. ...

  6. UIView 中 frame, bounds, center 属性的关系

    最近一直在学 iOS 开发,所以专门创建了这样一个类别,将自己学习中的一些问题整理,记录下来.由于自己是初学者,所以所写的文章非常基础,写这个类别一是为了给自己留下存 档,二是为了给和我有同样问题的初 ...

  7. android分析windowManager、window、viewGroup之间关系(一)

    本文将主要介绍addview方法,在windowManager.window.viewGroup中的实现原理.首先将介绍这些类结构关系,然后分析其内在联系,介绍实现原理,最后介绍重要的一个参数wind ...

  8. activity 、window与view的关系(下)

    在activity的attacth方法中,通过policymanager 的makenewwindow来创建window 而window的具体实现是phonewindow 接下来通过setconten ...

  9. activity 、window与view的关系 (上)

    我在研究任玉刚老师的<android开发艺术探索>的关于windowmanager那一章时,我发现自己对于acitivity.window和view之间的概念还是比较模糊. 然后查了一下a ...

随机推荐

  1. 04:全局解释器锁(GIL)

    1 全局解释器锁(GIL) 0 pypy(没有全局解释器锁) cpython(99.999999%)    -pypy python好多模块用不了,1 全局解释器锁,GIL锁(cpython解释器的问 ...

  2. Ajax 和 JSON

    Ajax:异步更新页面的技术,必须在http或者https网络网络协议下使用             1.原生js实现:共4步             2.jQuery:$.ajax(配置对象);   ...

  3. NOIP模拟测试10「大佬·辣鸡·模板」

    大佬 显然假期望 我奇思妙想出了一个式子$f[i]=f[i-1]+\sum\limits_{j=1}^{j<=m} C_{k \times j}^{k}\times w[j]$ 然后一想不对得容 ...

  4. 深入理解 sync.Once 与 sync.Pool

    深入理解 sync.Once 与 sync.Pool sync.Once 代表在这个对象下在这个示例下多次执行能保证只会执行一次操作. var once sync.Once for i:=0; i & ...

  5. ASW 工作流最佳实践(二):使用 ASW 并发调用函数

    在音视频转码.ETL 作业处理.基因数据处理等诸多场景中,我们都可以通过工作流并行调用云函数,将任务进行并行处理,大大提高任务处理的吞吐量,满足应用场景的高实时性.高并发能力. 在<使用 ASW ...

  6. 10、linux启动过程

    (1)linux启动说明: 第一步:开机自检,检查硬件,加载BIOS(帮我们找到启动盘是谁): 第二步:读取MBR(读取启动硬盘0柱面0磁道1扇区(512字节)的前446字节,找到装有操作系统的分区) ...

  7. CentOS-Docker搭建Rancher(单点)

    参考官方安装说明 服务器准备 节点服务器的硬件配置,可根据实际情况依据该表自行选择. 规模集群节点CPU内存 小 最多5个 高达50 2 8 GB 中 最多15个 最多200 4 16 GB 大 高达 ...

  8. 在Intellij IDEA中新建Web项目

    1.点击左上角 文件(F) ,--> new  --> 项目 2.勾选下面的复选框,下一步就是给项目起名字和存放项目的位置 2.在Web文件下新建 clsses 和 lib文件夹:http ...

  9. 使用Azure Congnitive Services 技术制作AI故事机

    引言 前一段时间有幸参加了微软MVP的AI方面的学习挑战赛,对于AI 这个新的领域的技术瞬间勾起了我的学习兴趣. 最近几年,不管是国内还是国外,AI都是一个异常火热的词.比如现在的自动驾驶技术,其实就 ...

  10. ESP32-OTA升级

    基于ESP-IDF4.1 1 #include <string.h> 2 #include "freertos/FreeRTOS.h" 3 #include " ...