Iframe之間及iframe與父窗體之間值的傳遞

( )父窗體調用iframe子窗體的例子:
1
// 將子iframetext的值賦給父窗體中一個text
document.getElementById('applyDate').value=window.frames["capitalList"].document.all('applytime').value;
2
// 父窗體中的一個按鈕onclick觸發子iframeformbutton1服務器端事件
window.frames( capitallist ).document.forms.item(0).button1.click(); 或寫做:
window.frames( capitallist ).document.form1.button1.click();


( )iframe子窗體調用父窗體的例子:
1
// iframe中的formbuttononclick事件給父窗體的一個text賦值
window.parent.document.all('applyDate').value=document.getElementById('applytime').value;
2
// 子頁面調用父窗體的某個按鈕的按鈕事件
window.parent.form1.button1.click()
( )iframe子窗體之間相互調用
// 右邊iframe中頁面的按鈕調用左邊的iframe中的頁面,讓左邊頁面得以刷新
parent.frame( menu ).window.location.reload();
相關文章
相關標籤/搜索