【JavaScript】window对象_frames数组对象
2015-03-08 01:04
489 查看
window对象的frames属性是一个数组,它与window对象的parent、top等
对象属性,都是用于对HTML的帧标签(<frameset>或<iframe>)进行编程的
javascript对象。(利用parent.frames.来调用)
framedemo.html:
脚本代码最好不要编写在framedemo.html中,
而是写在frame各个区域的网页中。
top.html:
2.top属性:
例子:
top.html:
bottom_right.html:
转载请注明出处:http://blog.csdn.net/acmman/article/details/44126609
对象属性,都是用于对HTML的帧标签(<frameset>或<iframe>)进行编程的
javascript对象。(利用parent.frames.来调用)
framedemo.html:
<html> <head> </head> <frameset rows="20%,80%"> <frame name=top src="top.html"> <frame name=bottom src="bottom.html"> </frameset> </html>
脚本代码最好不要编写在framedemo.html中,
而是写在frame各个区域的网页中。
top.html:
<input type=button value="刷新" onclink="window.parent.frames[1].loaction.reload()"> <!--刷新的是frame name=bottom--> <input type=button value="刷新2" onclink="parent.frames.bottom.loaction.reload()"> <input type=button value="刷新3" onclink="parent.frames['bottom'].loaction.reload()"> <input type=button value="刷新4" onclink="parent.frames.item(1).loaction.reload()"> <input type=button value="刷新5" onclink="parent.frames.item('bottom').loaction.reload()"> <input type=button value="刷新6" onclink="parent.bottom.loaction.reload()"> <input type=button value="刷新7" onclink="parent['bottom'].loaction.reload()"> <!--个人觉得摔性能2与6比较好记-->
2.top属性:
例子:
top.html:
<frameset rows="20%,*"> <frame name="a"> <frame name="x" src="bottom.html"> </frameset> bottom.html: <frameset cols="30%,*"> <frame name="b"> <frame name="c" src="bottom_right.html"> </frameset> bottom_right.html: <script language="javascript"> parent.parent.a.document.write("www.baidu.com"); </script>____________________________________________________
<frameset rows="20%,*"> <frame name="a"> <frameset cols="30%,*"> <frame name="b"> <frame name="c" src="bottom_right.html"> </frameset> </frameset>
bottom_right.html:
<script language="javascript"> parent.a.document.write("www.baidu.com"); </script>
转载请注明出处:http://blog.csdn.net/acmman/article/details/44126609
相关文章推荐
- 进一步认识Javascript中window对象的方法和属性以及重写alert方法,控制弹出窗口,frames[]数组
- javascript宿主对象之window.frames
- JavaScript 对象与数组参考大全
- JavaScript对象与数组参考大全
- JavaScript 对象与数组参考大全
- JavaScript 对象与数组参考大全
- JavaScript对象与数组参考大全
- JavaScript对象与数组参考大全
- JavaScript 对象与数组参考大全
- JavaScript对象与数组参考大全
- javascript教程 - 第三部分 window 和 frame 对象
- JavaScript对象与数组参考大全
- JavaScript对象与数组参考大全
- JavaScript 对象与数组参考大全
- javaScript 利用数组,对象的运用。。。
- JavaScript对象与数组参考大全
- JavaScript 对象与数组参考大全
- JavaScript对象与数组参考大全 选择自 xieyj 的 Blog
- JavaScript对象与数组大全
- JavaScript 对象与数组参考大全