title: How to bind an event handler to an iframe's onload with JQuery?
body: <p>I'm having some trouble getting binding to work with JQuery.</p>
  
  <pre><code>&lt;iframe id="wufooFormz7x3k1" height="281" allowtransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="http://foo111.com"&gt;&lt;/iframe&gt;
  
  &lt;script&gt;
  jQuery('#wufooFormz7x3k1').ready(function()
  {
    jQuery('#wufooFormz7x3k1').bind('onload', alert('hi1'));
    jQuery('#wufooFormz7x3k1').bind('onload', function() { alert('hi2') });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>The first bind generates an alert but then throws this error, and won't trigger alert for any subsequent loads of the iframe (which is what I'm trying to detect).</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'handler' of undefined and won't be triggered for subsequent onloads.
  </code></pre>
  
  <p>The second bind doesn't trigger at all.</p>
  
  <p>Ideally, what I want is to bind against the iframe's onload so I can generate an alert each and every time the iframe is reloaded.</p>