title: how to make preview webpage application
body: <p>I want to make a simple application having only one text field and a preview button. </p>
  
  <p>It should display the preview of the page in a div on the same page. Please see the blow code to get exact idea.</p>
  
  <pre><code>    &lt;form method="POST" action="" id="preview-form" &gt;
          &lt;input type="text" id="urltopreview" name="urltopreview" /&gt;
          &lt;input type="button" id="preview-button" value="Preview"&gt;
          &lt;div id="preview"&gt;&lt;/div&gt;
     &lt;/form&gt;
  </code></pre>
  
  <p>When I insert the URL and click Preview button, it should load the preview of that page in the div (having id="preview" ) using jquery &amp; ajax.</p>
  
  <p>I tried to use php function file_get_contents() to generate preview but I get broken images.</p>
  
  <p>Any idea?</p>