title: Replacement for document.write but with append function
body: <p>I want to now is there any function like document.write() on JavaScript but instead of replacing element it append them because I build a function for replacing user input with codes and it work but the problem is instead of adding codes on specific place but he replace the all page content.</p>
  
  <p>My functions code.</p>
  
  <pre><code>function one(json) {
          var j = 0;
          var img = new Array();
          var maxpost=json.feed.entry.length;
          for (var i = 0; i &lt; numposts1; i++) {
              var entry = json.feed.entry[i];
              var posttitle = entry.title.$t;
              var pcm;
              var posturl;
              var postAuthor = entry.author[0].name.$t;
              var postLabels = entry.category[1].term;
  
  if ((i&gt;0)&amp;&amp;(i&lt;maxpost)) {
  var trtd = '&lt;a href="'+posturl+'"&gt;'+posttitle+'&lt;/a&gt;&lt;h2&gt;'+posttitle+'&lt;/h2&gt;     &lt;span&gt;'+postAuthor+'&lt;/span&gt;&lt;span&gt;'+postLabels+'&lt;/span&gt;&lt;div&gt;'+img[i]+'&lt;/div&gt;'; 
  document.write(trtd);
  }
              j++;
          }
      }
  </code></pre>
  
  <p>and this is the second part of code</p>
  
  <pre><code>$(document).ready(function(){
    $('.widget-content').each(function(){
  var b = $(this).html();
      var a = b.match(/[^[\]]+(?=])/g);
  var code = $('#myscript').attr('src');
      var script= document.createElement('script');
      script.type='text/javascript';
      script.src=code;
  $('.HTML').append("&lt;script id='myscript' src='/feeds/posts/default/-/Break?published&amp;amp;alt=json-in-script&amp;amp;callback=one'&gt;&lt;\/script&gt;");
  
    });
  });
  </code></pre>
  
  <p><a href="http://test-khamsat-support-gig.blogspot.com/" rel="nofollow">Live demo for the problem</a></p>