2013-07-24 113 views
0

當您點擊打印筆記時,我期待另一個窗口彈出您記錄的筆記。在我的情況下,它一直顯示空白。從父頁面獲取內容

請讓我知道我是否應該提供更多的細節:

頁(1)與文本區域

<textarea id="sermon_notes" cols="5" rows="5"></textarea> 
<a href="../notes/print/forgiveness/index.html" target="_blank" class="btn_small_cmg">  <span>Print Notes</span></a> 

頁(2)使用JavaScript試圖拉你網頁上寫的信息( 1),所以它可以網頁上展示(2)

<html> 
    <head> 
    <title>Media | New Foundation Christian Ministries </title> 

     <link rel="stylesheet" href="../css/popout.css" media="screen" type="text/css" /> 
     <link rel="stylesheet" href="../css/print.css" media="print" type="text/css" /> 

    </head> 

    <body class="about"> 
     <div class="wrap"> 
    <div class="header"> 
    <a href="javaScript:window.print();" class="print"><span>Print</span></a> 
    <h1><img src="../images/logo.png" alt="New Foundation Christian Ministries" />  </h1> 
</div> 
<div class="content"> 
     <div class="page_header"> 
     <h2>Notes</h2> 
    </div> 
    <h1></h1> 
     <h1>some text</h1> 
     <small>ate</small> 

     <br/><br/><br/> 


      <h3>My Notes:</h3> 
      <p> 

      <script type="text/javascript"> 
       // Get the notes from the parent page 
       var message_notes = window.opener.document.getElementById('sermon_notes').value; 
       // Replace out the new line character with a <br> 
       message_notes = message_notes.replace(new RegExp("\\n", "g"),"<br />"); 
       document.write(message_notes); 
      </script> 
      </p> 

</div> 
<div class="footer"> 

    </div> 
</div> 
</body> 
</html> 
+0

jQuery在哪裏? index.html是否被稱爲空白? – putvande

+0

你並不是真的打開一個新窗口,而是一個'_blank',它不一樣。 – adeneo

+0

這正是我想要做的,似乎也沒有工作。 http://fellowshipdallas.org/media/player/media/what-we-should-know-about-the-end-times/video/ – user2608501

回答

0

我得到了它,我的上述代碼的工作就好了,是事實,我的鏈接不包含在HTTP而是文件。它不會工作,除非你有http,所以它不會在你的本地服務器上工作。

謝謝大家的幫助。