title: Set a variable in an Iframe
body: <p>Is it possible to create an Iframe using <code>document.createElement("iframe");</code> and then set a variable in the iframe's window object such as a namespace?</p>
  
  <p>I have tried doing something like this:</p>
  
  <pre><code>var Namespace = {}; 
  var iframe = document.createElement("iframe"); 
  iframe.src = "page.html"; 
  document.body.appendChild(iframe);
  var iwin = iframe.contentWindow || iframe.contentDocument.defaultView; 
  iwin.Namespace = Namespace;
  </code></pre>
  
  <p>But in page.html I try to log <code>Namespace</code> and it throws an undefined error.</p>