title: Why doesn't IE8 handle iframe onload events?
body: <p>Sample code:  </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;script&gt;
  function on_iframe_load() {
      document.getElementById('iframe_a').onload = function() {
          alert('Thanks for the visit!');
      };
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;iframe name="iframe_a" id="iframe_a"&gt;&lt;/iframe&gt;
  &lt;a href="http://www.example.com/" target="iframe_a" onclick="on_iframe_load();"&gt;Go!&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It works in all major browsers with no problem, but IE8 (and probably prior versions) don't understand it.  </p>
  
  <p><strong>Update</strong>: Just came up with a solution, but I'm not sure if it's right coding. Please review:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;script&gt;
              var clicked = false;
  
              function activate() {
                  clicked = true;
              }
  
              function pop() {
                  if (clicked) {
                      alert('Thanks for the visit!');
                  };
              }
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;iframe name="iframe_a" onload="pop();"&gt;&lt;/iframe&gt;
          &lt;a href="http://www.example.com/" target="iframe_a" onclick="activate();"&gt;Go!&lt;/a&gt;
  
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>