Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Frame/IFrame onload Event

Frame/IFrame onload Event

Frame/IFrame Object Reference Frame/IFrame Object


Definition and Usage

The onload event is triggered after a frame or iframe finishes loading.

Syntax

onload="

JavaScriptCode

"

Parameters Description
JavaScriptCode Required. The JavaScript code executed after the event is triggered.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onload event


Example

Example 1

Pop up "Frame is loaded" immediately after the frame finishes loading:

 

 

Try it »

Example 2

Pop up "Iframe is loaded" immediately after the iframe finishes loading:

Try it »


Frame/IFrame Object Reference Frame/IFrame Object