主窗口:a.html
<代碼>
<html>
<body>
<INPUT TYPE="button" VALUE="" ONCLICK="javascript:aa();">
</body>
<script type="text/javascript">
//向彈出頁傳入的數(shù)組
var jsjh=new Array('a','b');
alert(jsjh[0]);
function aa(){
//在路徑后寫上要出入的數(shù)組 "iframe.html",jsjh
window.showModalDialog("iframe.html",jsjh, 'dialogHeight:600px; dialogWidth:1000px; dialogLeft:(screen.availWidth/2-100); dialogTop:(screen.availHeight/2-50);center: yes;help:no;resizable:no;status:yes');
}
</script>
</html>
<代碼>
框架頁:iframe.html
<代碼>
<body>
<iframe src="in.html" frameborder="1" height="100%" name="kkk" scrolling="auto" width="100%"></iframe>
</body>
<代碼>
彈出頁面主頁:in.html
<代碼>
<html>
<body>
<script type="text/javascript">
//彈出頁接收父頁面?zhèn)鱽淼臄?shù)組 firefox需要加parent IE不需要
var a = window.parent.dialogArguments;
alert(a);
</script>
<iframe name="mainframe" marginwidth="0" marginheight="0" frameborder="0" src="in1.html" width="100%" scrolling="no" border="1" onload="this.height=450"></iframe>
<iframe name="mainframe2" marginwidth="0" marginheight="0" frameborder="0" src="in2.html" width="100%" scrolling="auto" border="1" onload="this.height=450"></iframe>
</body>
</html>
<代碼>
彈出頁面中iframe1:in1.html
<代碼>
<html>
<body>iframe1</body>
<script type="text/javascript">
//在iframe中取得in.html中的數(shù)組a
var a = parent.a;
alert(a[0]+"ffff");
</script>
</html>
<代碼>
彈出頁面中iframe2:in2.html
<代碼>
<html>
<body>iframe2</body>
<script type="text/javascript">
</script>
</html>
<代碼>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。