[轉貼] 另開子視窗傳值至母視窗以及呼叫母視窗函式
出處:
http://smallpoint-program.blogspot.tw/2012/12/javascript_17.html前幾篇都在講ifram如何傳值及呼叫母視窗函式,
今日就來講講另開視窗[window.open()],是要如何做到傳值效果。
1.子視窗傳值至母視窗
<script language=javascript>
function name(name) {
var name;
window.opener.document.getElementById('school_name').value = name;
}
</script>
2.子視窗傳值呼叫母視窗函式
<script language=javascript>
function name(name) {
window.opener.outside(name);//標紅字體則為母視窗的javascript的函式
}
</script>