title: How to load iframe content correctly in to <div in main page (same domain iframe)?
body: <p>I got an ifram that has many links in it and i am trying to copy those link correctly to my main page. My current code copy the links incorectly .For example if the
  actual hyper link is like this in iframe:</p>
  
  <pre><code>&lt;a href="./ok/doit.php"&gt; 5 &lt;/a&gt; 
  </code></pre>
  
  <p>after coping it in to main page the hyper links become like this :</p>
  
  <pre><code>http://ok.mysite24.com/spring/./ok/doit.php
  </code></pre>
  
  <p>so after clicking to those links from within my main page i go to dead links instead of actual links. is there away to fix this problem by copying iframe content correctly or should i modify my iframe content ?</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  function getFrameContents(){
     var iFrame =  document.getElementById('myframe');
     var iFrameBody;
     if ( iFrame.contentDocument ) 
     { // FF
       iFrameBody = iFrame.contentDocument.getElementsByTagName('body')[0];
     }
     else if ( iFrame.contentWindow ) 
     { // IE
       iFrameBody = iFrame.contentWindow.document.getElementsByTagName('body')[0];
     }
   alert(iFrameBody.innerHTML);
  
  document.getElementById('response').innerHTML = iFrameBody.innerHTML
  
   }
  &lt;/script&gt;
  
  &lt;iframe id ='myframe' src='http://www.mysite.com/ok.php'&gt;&lt;/iframe&gt;
  
  &lt;div id="response"&gt; 
      &lt;p&gt;&lt;a href="#" onMouseDown="getFrameContents()"&gt;getFrameContents! &lt;/a&gt;&lt;/p&gt;
  </code></pre>