title: grab global variable from an embedded iframe
body: <p>say an HTML page (Page.htm) contains the following...</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var vara = 'varA';
  &lt;/script&gt;
  </code></pre>
  
  <p>Now this page is loaded into an iframe from another page with...</p>
  
  <pre><code>&lt;iframe id="child_frame" src="http://mysite.com/Page.htm" /&gt;
  </code></pre>
  
  <p>From the parent page, I would like to get the value of the global 'vara' from Page.htm.</p>
  
  <p>None of the following lines work...</p>
  
  <pre><code>    window.frames['child_frame'].window.vara;
  
      window.frames['child_frame'].window['vara'];
  
      window.frames['child_frame'].contentWindow['vara']; 
      // in fact contentWindow returns undefined!!
  </code></pre>
  
  <p>Any help would be appreciated!</p>
  
  <p>UPDATE</p>
  
  <p>After looking at this problem more, and trying the various libraries that are available to get around this issue, I had the epiphany that since I have IIS control over both the main and iframe embedded websites, I can work within the cross domain scripting rules by using the same base URL for the various websites.  Also, the libraries that get around the problem appear to need constant updating as the browser vendors tighten their security with continuous updates.  It would really be a chore to have to always be updating the workaround for circumventing what the browser is trying to keep you from doing.</p>