`
lc52520
  • 浏览: 362061 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

iframe相关的参数传递【Z】

阅读更多

当一个页面中插入了iframe或者由不同的框架组成(fieldset)时,这种情况下,需要处理的业务逻辑比较常见的就是数据进行交互了

1.页面中插入了iframe情况

由于页面中插入了iframe,那么iframe就是一种从属于主窗体的关系

主窗体要取得iframe中的值:window.frames["iframe的名字"].document.getElementById("");

iframe要取得主窗体中的值:window.top.document.getElementById("");

iframe要取得iframe的值:window.top.frames["iframe的名字"].document.getElementById("");

2.页面由<fieldset></fieldset>组成

页面间的关系都是平等的

假如存在topFrame和mainFrame

topFrame要取得mainFrame中的值:window.top.frames["mainFrame"].document.getElementById("");

备注:上面的top都是直接定向于主窗体

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics