title: Trap the JS error of child window using onerror on parent page
body: <p>I am having a issue with IE, when I open a child window using javascript and attach onerror event on child window I am not getting JS error caught in OnLoad of child window. Below code is working fine in FF.
  here is code example:</p>
  
  <p><strong>Parent Page</strong>:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function openpage()
  {
      console.log('opening');
      var w = window.open('demo2.html', '_blank');
      //without setTimeout onerror is not working
      setTimeout(function(){w.onerror = function(msg, file, line) { alert(msg); };}, 3000)
      //w.onerror = function(msg, file, line) { alert(msg); };
  }
  &lt;/script&gt;
  &lt;/head&gt;
      &lt;body&gt;
          &lt;input type="button" onclick="openpage()" /&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Child Page code (demo2.html):</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  //function with error
  function fun(var1,var2){aler(var1);}
  &lt;/script&gt;
  &lt;/head&gt;
      &lt;body onload="fun(2,3)"&gt;
          &lt;input type="button" onclick="fun(2,3)" /&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please suggest a way to capture the JS error generated on child page If above way is not valid/correct.</p>
  
  <p>Thanks,
  Pankaj</p>