index.html 里 有个iframe,指向xx.html
<SCRIPT LANGUAGE="JavaScript">
function test(){
alert("iframe的 src=" + document.all.bottom.src);
alert("xx.html 里的js变量aa=" + bottom.aa);
alert("xx.html 里的input的值mytext.value="
+ bottom.document.all.mytext.value);
//调用xx.html里的f_xx方法
bottom.f_xx()
}
</SCRIPT>
<iframe id="bottom" src="xx.html" name="bottom"></iframe>
<button onclick="test()">click me</button>
<SCRIPT LANGUAGE="JavaScript">
var aa = "var in xx.html";
function f_xx()
{
alert("hello!");
}
</SCRIPT>
<input type="text" name="mytext" value="gogo">