title: document.write loading scripts dynamically
body: <p>I am trying to load script dynamically. This is my code:</p>
  
  <pre><code>document.write('&lt;script type="text/javascript"&gt;window.jQuery || document.write(\"&lt;script src=\'http://code.jquery.com/jquery-1.10.2.min.js\'&gt;&lt;/script&gt;\")&lt;/script&gt;');
  </code></pre>
  
  <p>This is inside B.js which is loaded as script on A.html. But I get error. The end script tag inside double quotes is treated as if it's nested script tag and breaking the code.</p>
  
  <p>Any ideas how to fix this?</p>