title: Cannot Add Script tag to Iframe Head or Body
body: <p>I am trying to add <code>&lt;script&gt;&lt;/script&gt;</code> tag to an <code>iframe</code> head or body but not able to succeed. </p>
  
  <pre><code>var iframe = $("iframe#demo),
      contents = iframe.contents(),
      body = contents.find('body');
  </code></pre>
  
  <p>Attempt one:</p>
  
  <pre><code>var script = document.createElement( 'script' );
  script.type = 'text/javascript';
  $(body).append(script);
  </code></pre>
  
  <p>Second attempt:</p>
  
  <pre><code>$("`&lt;script&gt;&lt;/script&gt;`").appendTo(contents.find('head'))
  </code></pre>
  
  <p>Either of the method above does not work for me.</p>
  
  <p>Let me know if anyone has some pointer.</p>
  
  <p>Thanks</p>
  
  <p>Viral</p>