zoukankan      html  css  js  c++  java
  • iframe中的页面如何触发父页面事件

    可采用iframe的JS调用父页面的JS

    如:父页面的JS代码为

    View Code
     1 function getValue() {
    2 document.getElementById("MyFormLayer").style.display = "none";
    3 var grid = document.getElementById("MainGrid");
    4 if (grid != null) {
    5 grid.style.display = "block"
    6 }
    7 var type = document.getElementById("IFRAME1").contentWindow.document.getElementById("TextBox1").value;//获取框架页面控件TextBox1的值,IFRAME1指框架ID
    8 document.getElementById("TYPE").value = type;
    9 document.getElementById("QUERY").click();//触发父页面QUERY按扭事件
    10 }

    框架页的JS代码为:
            function returnPath() {
                parent.window.getValue();
           }

  • 相关阅读:
    asp.net web生命周期
    图的数据结构1
    最长公共子串
    内部排序

    棋盘覆盖问题
    队列
    矩阵连乘问题
    图的数据结构2
    旅行售货员问题
  • 原文地址:https://www.cnblogs.com/pfcan66/p/2370032.html
Copyright © 2011-2022 走看看