JS打開新窗口,子窗口操作父窗口


<!--父窗口彈窗代碼開始-->

<script type="text/javascript">
function OpenWindow() {
window.open('WebForm1.aspx', '_blank', 'width=400,height=100,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes');
}
function ShowModalDialog() {
window.showModalDialog('WebForm1.aspx', '_blank', 'width=400,height=100,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes');
}

//參數說明如下:
//top=# 窗口頂部離開屏幕頂部的像素數
//left=# 窗口左端離開屏幕左端的像素數
//width=# 窗口的寬度
//height=# 窗口的高度
//menubar=... 窗口有沒有菜單,取值yes或no
//toolbar=... 窗口有沒有工具條,取值yes或no
//location=... 窗口有沒有地址欄,取值yes或no
//directories=... 窗口有沒有連接區,取值yes或no
//scrollbars=... 窗口有沒有滾動條,取值yes或no
//status=... 窗口有沒有狀態欄,取值yes或no
//resizable=... 窗口給不給調整大小,取值yes或no
</script>

<!--父窗口彈窗代碼結束-->

 

<!--子窗口操作父窗口代碼開始-->

function ChangeParent() {
$("#div_content", window.opener.document).text("test data!");
}

<!--子窗口操作父窗口代碼結束-->


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM