frame window 和open 的关系
建立一个如下的关系框架

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 的关系的更多相关文章
- 动态加载Layout 与 论Activity、 Window、View的关系
1)动态加载Layout的代码是 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null)); ...
- 图解:window与BOM的关系
window与BOM的关系: 1.https://www.jianshu.com/p/f5409202a835
- android 中的 window,view,activity具体关系
通过讨论这个问题,我们能够见识到google是对面向对象模式的理解,能够理解android底层的一些调用.这也是一道很常见的面试题. 我们这篇文章就来解决这四个问题: Android 中view的显 ...
- 动态载入Layout 与 论Activity、 Window、View的关系
1)动态载入Layout的代码是 getWindow().setContentView(LayoutInflater.from(this).inflate(R.layout.main, null)); ...
- DirectFB、Layer、Window、Surface之间关系
层(Layers) 表示一块儿独立的图像缓冲区.大多数的嵌入式设备都有多个层.他们由硬件使用合适的alpha值来blending,然后显示. 表面 (Surface) 用来保存像素数据的保留内存区域. ...
- UIView 中 frame, bounds, center 属性的关系
最近一直在学 iOS 开发,所以专门创建了这样一个类别,将自己学习中的一些问题整理,记录下来.由于自己是初学者,所以所写的文章非常基础,写这个类别一是为了给自己留下存 档,二是为了给和我有同样问题的初 ...
- android分析windowManager、window、viewGroup之间关系(一)
本文将主要介绍addview方法,在windowManager.window.viewGroup中的实现原理.首先将介绍这些类结构关系,然后分析其内在联系,介绍实现原理,最后介绍重要的一个参数wind ...
- activity 、window与view的关系(下)
在activity的attacth方法中,通过policymanager 的makenewwindow来创建window 而window的具体实现是phonewindow 接下来通过setconten ...
- activity 、window与view的关系 (上)
我在研究任玉刚老师的<android开发艺术探索>的关于windowmanager那一章时,我发现自己对于acitivity.window和view之间的概念还是比较模糊. 然后查了一下a ...
随机推荐
- 拦截导弹(CDQ分治,DP)
很好的题,值得细细说,(果然又是个假期望)....... 首先我们提取信息,显然这是个三维偏序问题 用简单的DP式子表示需要满足 f[i]=max(f[1--j]+1)(v[j]<v[i],h[ ...
- [INS-32033] Central Inventory location is not writable
这个是因为之前安装过一次图形界面,已经创建过Inventory,所以会报错. 解决:删除oraInventory这个目录.
- 百炼 POJ2393:Yogurt factory【把存储费用用递推的方式表达】
2393:Yogurt factory 总时间限制: 1000ms 内存限制: 65536kB 描述 The cows have purchased a yogurt factory that m ...
- 【春节歌曲回味 | STM32小音乐盒 】PWM+定时器驱动无源蜂鸣器(STM32 HAL库)
l STM32通过PWM与定时器方式控制无源蜂鸣器鸣响 l STM32小音乐盒,歌曲进度条图形显示与百分比显示,歌曲切换 l 编程使用STM32 HAL库 l IIC OLED界面编程,动画实 ...
- Unity 按空格一直触发Button点击事件的问题
#解决 这是由于Button中Navigation(导航)功能导致的. 将导航设置为None即可. 真是气死我了,我说为什么点击完按钮界面,按空格就一直触发界面,难搞
- FastApi持续更新
FastAPI 框架,高性能,易于学习,高效编码,生产可用 官方文档: https://fastapi.tiangolo.com FastAPI 是一个用于构建 API 的现代.快速(高性能)的 ...
- Binding(四):数据校验
除了上一节讲的类型转换器,Binding还自带数据校验功能,这节主要来讲一下. 跟类型转换器一样,数据校验需要我们继承ValidationRule类,实现其中的Validate方法,并写入我 ...
- POJ 1584 A Round Peg in a Ground Hole 判断凸多边形 点到线段距离 点在多边形内
首先判断是不是凸多边形 然后判断圆是否在凸多边形内 不知道给出的点是顺时针还是逆时针,所以用判断是否在多边形内的模板,不用是否在凸多边形内的模板 POJ 1584 A Round Peg in a G ...
- CentOS7搭建SFTP服务
CentOS7.5环境下搭建SFTP服务. 创建用户组及用户 创建用户组 # groupadd sftpgroup 创建用户 $ useradd -g sftpgroup -s /sbin/nolog ...
- 1.3.6、通过Path匹配
server: port: 8080 spring: application: name: gateway cloud: gateway: routes: - id: guo-system4 uri: ...