title: postMessage undefined error with dynamically added attribute
body: <p>I'm adding "<strong>name=true</strong>" attribute to iframe dynamically. Getting error "Cannot read property 'postMessage' of undefined"
    but its working fine on the console using same " window.iframe.true " </p>
  
  <p>updated: "win" return undefined</p>
  
  <pre><code>&lt;iframe src="crossdomain.com" id="iframe"&gt;&lt;/iframe&gt;
  
  &lt;script&gt;
      var win = window.iframe.nametrue;
      win.postMessage("statusPause", "othersite.com");
  &lt;/script&gt;
  </code></pre>