父級代碼<body><iframe name="my" src="a.html" border="0"></iframe> <script>
frames[0].fn1();
</script></body>子級a.html的代碼<script>
var i = 0; function fn1(){
alert("這里是子窗口");
}; </script>在父級中調(diào)用a.html的方法fn1,在firefox的代碼草稿紙中運(yùn)行ok,但是在源代碼中運(yùn)行報(bào)錯TypeError: frames[0].window.fn1 is not a functionframes[0].fn1();
在父級中獲取子級iframe框架中的方法,疑問
米脂
2018-08-07 13:13:45