天天看點

open打開視窗并且獲得打開視窗的視窗對象

//主窗體

<script language="javascript" type="text/javascript">

 function opens(){

  //打開F:/2.html頁面

  

  window.open("F:/2.html","a","resizable=no");

  //參數一:打開的頁面 參數二:頁面的名稱 參數三:頁面的相關屬性設定

    //window.open("open.html","abc","height=300,width=300,location=yes,menubar=1");//yes和1表示顯示,no和0表示不顯示 

 }

</script>

//F:/2.html頁面

function show(){

//獲得主窗體對象中的id為txt的控件value,并且為其指派

  window.opener.document.getElementById("txt").value= document.getElementById("text").value; 

  //重新整理主窗體并關閉

  //window.opener.location.reload();//重新整理

  //window.close();//關閉

 }

轉載于:https://www.cnblogs.com/danmao/p/3819201.html

繼續閱讀