YouTip LogoYouTip

Event Frame Onload

# Frame/IFrame onload Event [![Image 8: Frame/IFrame Object Reference](#) Frame/IFrame Object](#) * * * ## Definition and Usage The onload event is triggered when a frame or iframe finishes loading. ## Syntax onload="_JavaScriptCode_" | Parameter | Description | | :--- | :--- | | JavaScriptCode | Required. The JavaScript code to execute after the event is triggered. | * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) All major browsers support the onload event. * * * ## Examples ## Example 1 Display "Frame is loaded" immediately after the frame finishes loading: function load() { alert("Frame is loaded"); } [Try it Β»](#) ## Example 2 Display "Iframe is loaded" immediately after the iframe finishes loading: function load() { alert("Iframe is loaded"); }

Your browser does not support iframes.

[Try it Β»](#) * * Frame/IFrame Object](#)
← Event Img OnloadProp Iframe Width β†’