HBCMS更多的中文手册参考:

onsave Event

DHTML文档教程

Fires from a persisted element when the Web page is saved or bookmarked, or when the user navigates away from the page.

dhtml语法

Event propertyobject.onsave = handlerJScript only
object.onsave = GetRef("handler")Visual Basic Scripting Edition (VBScript) 5.0 or later only
Named script <SCRIPT FOR = object EVENT = onsave> Internet Explorer only

Event Information

BubblesNo
CancelsYes
To invoke
  • Save the Web page.
  • Bookmark the Web page.
  • Navigate to another page.
Default action Initiates any action associated with this script.

Available Properties

Available Properties

DHTML代码范例

This example shows how to use the onsave event for a persistence behavior.

<HTML>
<HEAD>
<META NAME="save" CONTENT="favorite">
<STYLE>
.saveFavorite {behavior:url(#default#savefavorite);}
</STYLE>
<SCRIPT>
function fnSaveInput(){
alert("The onsave event fired.");
oPersistInput.setAttribute("sPersistValue",oPersistInput.value);
}
function fnLoadInput(){
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

saveFavorite, saveHistory, saveSnapshot