onload Event | Internet Development Index |
Fires from a persistent element when the page reloads.
Syntax
Event property object.onload = handler JScript only object.onload = GetRef("handler") Visual Basic Scripting Edition (VBScript) 5.0 or later only Named script <SCRIPT FOR = object EVENT = onload> Internet Explorer only
Event Information
Bubbles No Cancels Yes To invoke Load the persistent Web page from a favorite or shortcut or through an Internet address. Default action Initiates any action associated with this script. The onload event for behaviors overrides the onload event for DHTML objects.
Available Properties
Example
This example shows how to use the onload event for a persistence behavior.
<HTML> <HEAD> <META NAME="save" CONTENT="favorite"> <STYLE> .saveFavorite {behavior:url(#default#savefavorite);} </STYLE> <SCRIPT> function fnSaveInput(){ oPersistInput.setAttribute("sPersistValue",oPersistInput.value); } function fnLoadInput(){ alert("The onload event fired."); oPersistInput.value=oPersistInput.getAttribute("sPersistValue"); } </SCRIPT> </HEAD> <BODY> <INPUT class=saveFavorite onsave="fnSaveInput()" onload="fnLoadInput()" type=text id=oPersistInput> </BODY> </HTML>
Standards Information
There is no public standard that applies to this event.
Applies To
saveFavorite, saveHistory