Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1611578
  • 博文数量: 292
  • 博客积分: 10791
  • 博客等级: 上将
  • 技术积分: 2479
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-20 21:06
文章分类

全部博文(292)

文章存档

2011年(31)

2010年(261)

分类: 系统运维

2010-09-12 16:40:39

1.取得iframe对象用:

 document.getElementById("iframeId")

2.取得iframe里的页面的window对象用:

 document.getElementById("iframeId").contentWindow

或是

window.frames["iframeName"]

3.取得iframe里的页面的docuemnt对象用:

 document.getElementById("iframeId").contentWindow.document

或是

window.frames["iframeName"].document

4.访问iframe里的页面中的对象用:

 document.getElementById("iframeId").contentWindow.document.getElementById("objId")

或是

window.frames["iframeName"].document.getElementById("objId")

5.访问iframe里的页面中的javascript代码用:

 document.getElementById("iframeId").contentWindow.functionName()

或是

window.frames["iframeName"].functionName()

 

总结:

访问页面里的对象通过document对象.

访问页面里的javascript通过window对象.

阅读(6400) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-09-15 14:43:07

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com