javascript在不同页面之间传值示例
来源:互联网 发布:大数据分析的算法 编辑:程序博客网 时间:2024/06/09 02:52
主页面:
1.html
<button id="button1" onclick="window.open('1.html','name','height=200,width=150');"></button>
<script>
var newwindow = '';
function popitup(url) {
if (!newwindow.closed && newwindow.location) {
newwindow.location.href = url;
}
else {
newwindow=window.open(url,'name','height=200,width=150');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
popitup('2.html');
</script>
弹出页面:
<html>
<body>
2.html<br/>
<button onclick="opener.button1.value='new value'"></button>
<body>
</html>
解释:
主要应用opener定位弹出窗口的父窗口。
1.html
<button id="button1" onclick="window.open('1.html','name','height=200,width=150');"></button>
<script>
var newwindow = '';
function popitup(url) {
if (!newwindow.closed && newwindow.location) {
newwindow.location.href = url;
}
else {
newwindow=window.open(url,'name','height=200,width=150');
if (!newwindow.opener) newwindow.opener = self;
}
if (window.focus) {newwindow.focus()}
return false;
}
popitup('2.html');
</script>
弹出页面:
<html>
<body>
2.html<br/>
<button onclick="opener.button1.value='new value'"></button>
<body>
</html>
解释:
主要应用opener定位弹出窗口的父窗口。
- javascript在不同页面之间传值示例
- 在不同的页面之间用javascript传递参数
- javascript不同页面传值
- JS 不同页面之间的传值
- PHP在不同页面之间传值的三种常见方式
- 不同页面之间传递值
- 在不同页面之间传递参数
- 在两个html页面之间传值小示例
- JAVASCRIPT 不同页面传值问题 解决方案
- 如何不同的页面和hook之间传值?
- 微信小程序不同页面之间的传值
- 通过协议在页面之间传值
- 在静态HTML页面之间传值
- 在两个html页面之间传值
- PHP在不同页面间传递Json数据示例
- PHP在不同页面间传递Json数据示例代码
- jsp在不同页面或者用户之间共享数据
- 不同页面之间传值除了Cookie,Session之外,还可以使用页面的上下文对象
- 夜与树的对话
- 关于__cdecl,__fastcall与__stdcall 等几个关键字的说明
- asp.net和j2ee的三层结构代码比较
- “Hello World”程序的改进(面向对象的Hello World)
- C++的平衡二叉树程序(暂时没有加入调整算法)
- javascript在不同页面之间传值示例
- CVS初步
- 跟我一起写 Makefile(十三)
- 从易到难编写C++程序,(1)问题:把键盘输入的字符串逆序输出。
- 美化文件上传控件
- 从微软下载Vista Ultimate 中文旗舰版
- 比JUnit4更酷的Annotation @Test checkMethod Annotation
- Exchange Server 2003邮件服务器系统的基本部署思路
- 交易印花税税率,由现行1‰调整为3‰