title: Adding a DIV from a file named A to a new window opened using window.open() from file named B in grails
body: <p>I have a template named _A.gsp.In it some search results are shown.When each result is clicked,a new window is opened.I have coded for this as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
        function openWin()
         {
            myWindow=window.open('','','width=200,height=100');
            myWindow.document.write("&lt;p&gt;This is 'myWindow'&lt;/p&gt;");
            myWindow.focus();
         }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the body:</p>
  
  <pre><code>&lt;table cellpadding="0" cellspacing="0"&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th class="small"&gt;&lt;g:message code="Company Names"/&gt;&lt;/th&gt;
  
      &lt;/tr&gt;
  &lt;/thead&gt;
  
  &lt;tbody&gt;
      &lt;g:each in="${results}" &gt;
         &lt;tr&gt;
           &lt;td&gt;
           &lt;a onclick="openWin();" &gt; ${results}&lt;/a&gt;
  
  
           &lt;/td&gt;
  
         &lt;/tr&gt;
      &lt;/g:each&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>    </p>
  
  <p>This is working fine.Now what i need is that the new window should show a particular div say id="profile", when opened instead of what it is showing now.This div is in a separate file say _B.gsp. How can I do that using the same window.open()?</p>