HBCMS更多的中文手册参考:

save Method

DHTML文档教程

Saves an object participating in userdata persistence to a userdata store.

dhtml语法

userdata.save(sstorename)

parameters

sStoreName Required. Stringthat specifies the arbitrary name assigned to a persistent object within a UserData store.

Return Value

No return value.

Remarks

The save method writes information into a UserData store. You can determine access to a UserData store by specifying a path within the immediate directory tree between the Web root and the current folder. For example, if you save the UserData store in the /private/ folder, a Web page located in the /public/ folder cannot access the UserData store.

This method requires an object participating in userData persistence, where that object has an id and a class name equal to the desired persistence behavior.

DHTML代码范例

This example uses the save method to save an object participating in userData persistence to a UserData store.

<HEAD>
<STYLE>
.userData {behavior:url(#default#userdata);}
</STYLE>
<SCRIPT>
function fnLoad(){
oPersistInput.load("oDataStore");
oPersistInput.value=oPersistInput.getAttribute("sPersistAttr");
}
function fnSave(){
oPersistInput.setAttribute("sPersistAttr",oPersistInput.value);
oPersistInput.save("oDataStore");
}
</SCRIPT>
</HEAD>
<BODY >
<INPUT type=text class=userData id=oPersistInput>
<INPUT type=button value="Load Attribute" onclick="fnLoad()">
<INPUT type=button value="Save Attribute" onclick="fnSave()">
</BODY>
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 method.

Applies To

userData

更多语法参考

introduction to dhtml behaviors, Introduction to Persistence