Html父子窗口之间传值

来源:百度文库 编辑:神马文学网 时间:2024/04/23 14:41:47
parent.html



子窗口传值给父窗口            function openWin(u, w, h) {                 var l = (screen.width - w) / 2;                 var t = (screen.height - h) / 2;                  var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;                     s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no';                  open(u, 'oWin', s);          }      function openIt(){       window.open("page2.htm",400,300);      }







child.html




子窗口传值给父窗口

function goback(obj){
window.opener.document.getElementById("text1").value = obj.value;
window.close();
}