title: iframe onload in chrome vs IE11
body: <p>I've been writing my first webapp using Chrome (because of the neat built-in Inspect tool) and all was fine until I tested in IE11 .</p>
  
  <p>It's basically a form &amp; iframe that is used for uploading a file (but in the snippet I've just focused on minimal reproduction of the behavior by cutting all that out).  </p>
  
  <p>The behavior is that in Chrome I click "Submit" and the form triggers the iframe onload event and run some code.  In IE11, the onload fires as the page is loaded, and when Submit button is clicked, it fires twice.</p>
  
  <p>It seems like I should be using some other event handler, but not sure what to catch.  I tried onsubmit, but it does nothing.</p>
  
  <p>Code from html block:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form enctype = "multipart/form-data" target="upload-iframe"&gt;
    &lt;input type = "submit" /&gt;
  &lt;/form&gt;
  &lt;iframe name="upload-iframe" id="myFrame" hidden="hidden"&gt;&lt;/iframe&gt;
  
  &lt;script type="text/javascript"&gt;
    var iframe = document.getElementById('myFrame');
    iframe.onload = function() {
      alert("I'm doing something");
    }
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks!</p>