The load and unload events fire when an asset loads, or the entire page unloads.
Note that the load and unload events should also fire when you use the Back and Foward buttons to navigate.
For some silly reason FF7b on Windows refuse to load my test iframe. The Mac version works fine, though.
Test | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 | IE10 pr2 | FF 7.0 Win | FF 6.1 Mac | Saf 5.1 Win | Saf 5.1 Mac | Chrome 14 Win | Chrome 13 Mac | Opera 11.51 Win | Opera 11.51 Mac |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Page
load and unload
|
Yes | Untest |
Yes | Yes | Yes | Incom |
||||||||
The load event fires when a page is fully loaded, including all of its assets. The unload event fires when a page starts to unload. This should always happen, regardless of navigation method.
|
||||||||||||||
Image
load
|
Yes | Yes | Yes | Yes | Yes | |||||||||
When an image file is loaded the load event should fire from the |
||||||||||||||
Script
load
|
No | Yes | Yes | Yes | Yes | Yes | ||||||||
When a script file is loaded the load event should fire from the |
||||||||||||||
CSS
load
|
Not tested | Yes | No | No | No | Yes | ||||||||
When a CSS file is loaded the load event should fire from the |
||||||||||||||
iframe
load
|
Not tested | No | Yes | Untest |
Yes | Yes | Yes | Yes | ||||||
When an HTML page is loaded into an iframe the load event should fire from the |
||||||||||||||
Test | IE 5.5 | IE 6 | IE 7 | IE8 | IE9 | IE10 pr2 | FF 7.0 Win | FF 6.1 Mac | Saf 5.1 Win | Saf 5.1 Mac | Chrome 14 Win | Chrome 13 Mac | Opera 11.51 Win | Opera 11.51 Mac |
No browser fires an error event when a style sheet resource isn’t found.