Fires from a persistent element when the page reloads.
Syntax
Inline HTML <ELEMENT onload = "handler" ... > All platforms Event property object.onload = handler JScript (compatible with ECMA 262 language specification) only Named script <SCRIPT FOR = object EVENT = onload> Internet Explorer only
Remarks
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.
Event Object Properties
Although event handlers in the document object model do not directly receive parameters, the handler can query the event object for data. For a list of properties of the event object relevant to an onload event handler, click the following link.
srcElement Retrieves the object that fired the event.
Example
This example shows how to use the onload event for a persistence behavior.
Sample Code
<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>
Applies To
saveFavorite, saveHistory