Pass a Javascript Object to an HTML iframe (as an Object)
<p>A MainWindow creates a JavaScript object that the ChildWindow needs to utilize utilize.</p>

<p>My MainWindow.html looks like this at the moment</p>

<pre><code>&lt;html&gt;
  &lt;body&gt;
    &lt;script&gt;
      var varObject = {type:"Error", message:"Lots"};
    &lt;/script&gt;
    &lt;iframe class="child" src="ChildWindow.html"&gt;&lt;/iframe&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The ChildWindow.html looks like this</p>

<pre><code>&lt;html&gt;
  &lt;body&gt;
    &lt;script&gt;
      console.log(varObject.type); // goal is to log "Error"
    &lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The ChildWindow is trying to use the object that was created in the MainWindow which of course it can't because I don't yet know how to pass it.</p>

<p>I've tried to Google this but most of the solutions I found involved passing the values as strings instead of as a variable.</p>