js的跨frame的调用,急用,马上结
主页面:
……
MAP_PANE.childNodes[0].innerHTML = " <iframe width=\ "100%\ " height=\ "100%\ " frameborder=\ "0\ " scrolling=\ "auto\ " src=\ "tongfang/gis/index.html\ "> </iframe> ";
……
index.html:
……
<script type= "text/javascript " src= "js/Util.js "> </script>
<script type= "text/javascript " src= "js/GIS.js "> </script>
<script language= "JavaScript ">
……
GIS.outPutMap();
……
现在我要在主页面调用GIS.js的方法,可以做到吗?
------解决方案-------------------- <body>
<iframe id= "s " src= "9.htm "> </iframe>
</body>
<script>
function c()
{
if(document.all.s.readyState== "complete ")
window.frames[ "s "].window.h();
}
document.all.s.onreadystatechange=c;
</script>
<!--9.htm-->
<script>
function h()
{
alert( "kkkk ");
}
</script>