zoukankan      html  css  js  c++  java
  • iframe父子页面间互相调用方法和属性

    <iframe src="VideoController.do?videoPlay" name="topFrame" ></iframe> 

    topFrame 是父级页面iframe的name属性

    1、父级页面调用子级页面

    (1)父级页面调用子级页面方法 

      topFrame.window.子级页面方法();

    (2)父级页面调用子级页面属性    获取值、显示隐藏、变量

      topFrame.window.document.getElementById("back").style.display="block";

      topFrame.window.document.getElementById("back").innerText;

      topFrame.window.document.getElementById("back").value;

      topFrame.window.cId;

    2、子级页面调用父级页面

    (1)子级页面调用父级页面方法

      window.parent.父级页面方法();

    (2)子级页面调用父级页面属性    获取值、显示隐藏、变量

      twindow.parent.document.getElementById("PtzPreset1").style.display="block";

      window.parent.document.getElementById("PtzPreset1").innerText;

      window.parent.document.getElementById("back").value;;

      window.parent.cId;

  • 相关阅读:
    vim使用技巧
    排序
    2020-3-27 学习面向对象的笔记
    小圆圈第三章答案
    内置函数部分用法
    Pycharm快捷键
    小猿圈第二章答案
    Typora学习笔记
    AI的真实感
    Unity 横版2D移动跳跃问题——关于一段跳与二段跳
  • 原文地址:https://www.cnblogs.com/dxt510/p/10432043.html
Copyright © 2011-2022 走看看