`

iframe父类与子类之间函数调用

阅读更多
子页面调用父类JavaScript
1:window.top //最顶层窗口
2:window.self //当前窗口
3:window.parent //父级窗口
iframe父页调用子页函数:
主页:

父页面:t1.jsp
<iframe    name=a1    id=iframe1    src="t2.asp"></iframe>  
   <input    type=button    value=button1    name=button1  
   onclick="a1.window.Test()">  

子页面t2.jsp:

<script>  
  function Test(){  
    alert("TEST");  
  }  
</script>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics