专著于富媒体技术~
本站某些作品来源于互联网,如果侵犯了您的利益,请留言说明

本文详细介绍JavaScript静态页面值传递之Window.open篇

  Window.open篇  

  这两窗口之间存在着关系.父窗口parent.htm打开子窗口son.htm  

  子窗口可以通过window.opener指向父窗口.这样可以访问父窗口的对象.  

  Post.htm  

<input type=text name=maintext>
<input type=button value="Open">
Read.htm
<script language="javascript" >
//window.open打开的窗口.
//利用opener指向父窗口.
var parentText = window.opener.document.all.maintext.value;
alert(parentText);
</script>

  

  优点:取值方便.只要window.opener指向父窗口,就可以访问所有对象.  

    不仅可以访问值,还可以访问父窗口的方法.值长度无限制.  

  缺点:两窗口要存在着关系.就是利用window.open打开的窗口.不能跨域.  

JavaScript静态页面值传递 - Cookie篇
JavaScript静态页面值传递 - Window.open篇
JavaScript静态页面值传递 - URL篇

            


作者:gdgzboy@牛C网
地址:http://www.niuc.net/post/603/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!



发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写