Load event for iFrame not fired in IE

Muleskinner picture Muleskinner · Dec 2, 2010 · Viewed 31.7k times · Source

Why is the load event not fired in IE for iFrames?

Please take a look at this example.

Work perfectly as expected in FF and Chrome, but IE fails.

Answer

Seis picture Seis · Dec 21, 2010

I think for iframes in Internet Explorer you can't set that event handler (onload) programmatically, you need to specify it in your markup.

Something like:

<iframe id="myFrame" onload="myFunction();"></iframe>

Otherwise IE is just going to ignore the function.