父窗口调用子窗口的值

父窗口的js: <script language="javascript">
 function say() {
  document.getElementById("title").innerHTML = window.frames[0].test();
 }
</sscript>

 

 

html代码:<body onload="say()">
  <div class="logo"></div>
  <div class="tag">
   当前位置:
   <strong><span id="title"></span>
   </strong>
  </div>
  <div id="content">
   <!--插入内容-->
   <iframe scrolling="no"
    src="<%=request.getContextPath()%>/examineeInfo/totestFrame1.action"
    style="background-color: transparent;" frameborder="0"
    allowTransparency="true" onload="iframe_resize(),say()"
    name="myFrame"></iframe>
  </div>
  <div id="foot"></div>
 </body>

 

 

 

 

子窗口、js

 

 <script type="text/javascript">
 function test() {
  var a = document.getElementById("y").innerHTML;
  return a;
 }
</script>

 

 

html

 <h1 class="xuzhi" id="y">
     测试须知
    </h1>

 

 在子窗口中调用

 

<a
      href="<%=request.getContextPath()%>/examineeInfo/toTesttestFrame3.action"
      class="nextbtn" onclick=
 opener.say();s

你可能感兴趣的:(父窗口调用子窗口的值)