(
一)父窗體調用iframe子窗體的例子:
1
、
//
將子iframe中text的值賦給父窗體中一個text
document.getElementById('applyDate').value=window.frames["capitalList"].document.all('applytime').value;
2
、
//
父窗體中的一個按鈕onclick觸發子iframe中form的button1服務器端事件
window.frames(
「
capitallist
」
).document.forms.item(0).button1.click();
或寫做:
window.frames(
「
capitallist
」
).document.form1.button1.click();
(
二)iframe子窗體調用父窗體的例子:
1
、
//
子iframe中的form的button的onclick事件給父窗體的一個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();