title: Is it possible to set the root path of an dynamically created iframe in JavaScript or html?
body: <p>Here what i'm trying to do :</p>
  
  <pre><code>var html = '&lt;html&gt;&lt;head&gt;&lt;script src="/js/script.js"&gt;&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;';
  var iframe = document.createElement('iframe');
  var iframeDocument = iframe.contentWindow.document;
  iframeDocument.open();
  iframeDocument.write(html);
  iframeDocument.close();
  </code></pre>
  
  <p>I want to set the relative path of my iframe. My script is at <a href="http://qwerty.com/iframe/js/script" rel="nofollow">http://qwerty.com/iframe/js/script</a> but my top page is at <a href="http://qwerty.com/" rel="nofollow">http://qwerty.com/</a> so the script do not load. Is it possible to set the root path of an dynamically created iframe in JavaScript or html?</p>