title: Create an iframe then append data to it with jQuery
body: <p>I am trying do some modification to an greasemonkey userscript to implement a feature I need. The code is like</p>
  
  <pre><code>showAddress:function(addrString,type)
  {
          this.addrBox=$('&lt;div id="batchPublish"&gt;&lt;/div&gt;')
          .append('&lt;div id="batchHeader"&gt;&lt;/div&gt;')
          .append('&lt;div id="batchContent" style="float:left;clear:both"&gt;&lt;/div&gt;');
  
     .........
  
   var batchContent=this.addrBox.find('#batchContent')
          .append('&lt;pre width="300" style="text-align:left" id="batchedlink"&gt;&lt;/pre&gt;'); 
  
           this.addrBox.find('#batchedlink').css({'width':'500px','height':'250px','overflow':'auto','word-wrap': 'break-word'})
          .append(addrString); 
  
          $.blockUI({message:this.addrBox,css:{width:"520px",height:"300px"}}); }
  </code></pre>
  
  <p>Basically this code writes data to html. What I want to implement is to have "addrString" written to an iframe embedded. Now It's in the "pre" tag. I have tried many approaches but still no luck. Iframe was always empty. 
  I am completely a novice in javascript and unclear whether this is possible.</p>
  
  <p>Thank you for the help.</p>