Click to return to the DHTML, HTML     
EVENTRESTART Attribute | ...     FOLDER Attribute | folder...     Default Behaviors Referen...    
Web Workshop  |  DHTML, HTML & CSS

expires Property


Sets or retrieves the expiration date of data persisted with the userData behavior.

Syntax

HTMLN/A
ScriptingoPersistObject.expires [ = sUTCString ]

Possible Values

sUTCStringString that specifies the expiration date in UTC (Universal Time Coordinate) format.

The property is read/write with no default value.

Remarks

The expires property designates the amount of time that persisted information is available. Microsoft® Internet Explorer removes the persisted information when the browser checks the date and the designated time has expired.

Example

This example uses the expires property to set the expiration date of persisted data to one minute after the information is persisted.

Sample Code

<STYLE>
.userData { behavior: url(#default#userdata)}
</STYLE>

<SCRIPT>
function fnSave(){
   var oTimeNow = new Date(); // Start Time
   oTimeNow.setMinutes(oTimeNow.getMinutes() + 1);
   var sExpirationDate = oTimeNow.toUTCString();

   oPersistDiv.expires = sExpirationDate;
   oPersistDiv.setAttribute("sData",oPersistText.value);
   // Save the persistence data as "sTimeout".
   oPersistDiv.save("sTimeout");
}
</SCRIPT>

:

<DIV CLASS = "userData" ID=oPersistDiv onsave = "fnSave()" >
<INPUT TYPE=text ID=oPersistText>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
userData

See Also

Persistence Overview



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.