save Method

MS Office DHTML, HTML & CSS

save Method


Saves an object participating in userData persistence to a UserData store.

Syntax

oPersistObject.save(sStoreName)

Parameters

sStoreName Required. String that 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.

Example

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

Sample Code

<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 Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
userData

See Also

dhtml behaviorsInternet Link, persistence overviewInternet Link

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.