获取父子框架的内容

来源:互联网 发布:qt5 gui编程 编辑:程序博客网 时间:2024/05/17 07:02

  获取父框架的内容:
  window.parent.id; ("id"为你要获取该值的名称);
  
  parent.document.getElementById("xxx");
  
  parent.document.getElementsByTagName("body")[0];
  
  
  获取子框架的内容:
  (第一个getElementById对象是子框架ID)
  
  document.getElementById("xxx").contentWindow.document.getElementById("xxxx");
  
  document.getElementById("xxx").contentWindow.document.getElementsByTagName("body")[0];
0 0
原创粉丝点击