2014-01-22 50 views
0

Parent.jsp:DISPLY父頁面的div內容到子頁面

<script>function newWindow(){window.open("child.jsp","child",'toolbar = no, status = no beforeShow'); 
</script> 
<form action="child" name="order" id="email" method="post"><BUTTON class="" type="submit" onclick=newWindow();>ALL Item</BUTTON></form:form> 
<div id="parent_content"><h1>Testing...</h1></div> 

Child.jsp:

<script>window.opener.document.getElementById("parent_content").innerHTML;</script> 

我需要顯示 「parent_content」 在兒童頁div內容使用javascript。

+0

會使用''在這種情況下,有用嗎? – ElliotSchmelliot

回答

0

請嘗試使用此方法。

function newWindow(){ window_handler = window.open(... 

然後經過窗口加載

window_handler.document.getElementById(TARGET).innerHTML = 
          document.getElementById('parent_content').innerHTML;