title: Inject HTML, CSS and JAVASCRIPT in iFrame issue
body: <p>I am trying to build something similar to Tinkerbin, or JSfiddle.
  It's for a personal project.</p>
  
  <p>Here's what I got for now :</p>
  
  <p><a href="http://mediodesign.ca/cms-test/" rel="nofollow">http://mediodesign.ca/cms-test/</a></p>
  
  <p>Everything's working, except the JAVASCRIPT tab. I followed the "How to Inject Custom HTML and CSS into an iframe" tutorial on Nettuts (http://net.tutsplus.com/tutorials/html-css-techniques/how-to-inject-custom-html-and-css-into-an-iframe/).</p>
  
  <p>Here's my modified javascript code :</p>
  
  <pre><code>(function() {
  $('.grid').height( $(window).height() );    
  
  var contents = $('iframe').contents(),
      body = contents.find('body'),
      styleTag = $('&lt;style&gt;&lt;/style&gt;').appendTo(contents.find('head')),
      jsTag = $('&lt;script&gt;&lt;\/script&gt;').appendTo(contents.find('head'));
  
  $('textarea').keyup(function() {
      var $this = $(this);
      if ( $this.attr('id') === 'html') 
      {
      body.html( $this.val() );
      } 
      else
      {
      styleTag.text( $this.val() ), 
      jsTag.text( $this.val() );
      }
  
  });  })  ();
  </code></pre>
  
  <p>I added the <code>jsTag = $('&lt;script&gt;&lt;\/script&gt;').appendTo(contents.find('head'));</code> line and <code>jsTag.text( $this.val() );</code>.</p>
  
  <p>I'm pretty sure it has something to do with the <code>jsTag = $('&lt;script&gt;&lt;\/script&gt;')</code> part.
  Why is <code>&lt;style&gt;&lt;/style&gt;</code> is working but the <code>&lt;script&gt;&lt;/script&gt;</code> is not?</p>
  
  <p>Please help me fix this, I've been working on this issue for the last 2 hours!</p>
  
  <p>Thanks again</p>