Fires from a persistent element when the page reloads.
dhtml语法
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
Available Properties
DHTML代码范例
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>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
是否符合公共标准
There is no public standard that applies to this event.
Applies To