In fact, we can use the userData behavior in Microsoft DHTML default behavior to achieve this function.
Because many netizens have asked this question, I have sorted it out and provided three examples. The following will give an introduction to the use of this behavior:
UserData Behavior (userData Behavior):
1. Description:
userData behavior writes data A UserData store to save data. userData can save data in XML format on the client computer. If you are using Windows 2000 or Windows XP, it is saved in the C:Documents and SettingsLimingUserData folder (if The operating system is not installed on the C drive, then C should be the partition where the operating system is located).
This data will always exist unless you delete it manually or set the expiration date of the data with a script.
The userData behavior provides a more dynamic and larger-capacity data structure than Cookie. The data size of the UserData storage area per page can reach 64 Kb, and each domain name can reach 640 Kb.
The userData behavior allocates UserData storage for each object through sessions. Use the save and load methods to save the UserData storage area data in the cache. Once the UserData storage area is saved, even if the IE browser is closed or refreshed, the data can be reloaded without loss the next time you enter the page.
For security reasons, the same protocol uses the same folder to save UserData storage area data.
For security reasons, a UserData store is available only in the same directory and with the same protocol used to persist the store.
Used after applying userData behavior on HTML, HEAD, TITLE and STYLE tags The save and load methods will error.
Setting the userData behavior (proposed) class on the HTML, HEAD, TITLE, or STYLE object causes an error when the save or load method is called.
Must be declared inline or in the HEAD section of the document as follows Styles:
userData behavior available for Microsoft? Win32 ?And IE 5.0 or above on Unix platform, Netscape is not supported.
2. Syntax:
HTML
Script object.style. behavior = "url('#default#userData')"
object.addBehavior ("#default#userData")
Note: The sID parameter is a unique id that can describe the tag. The ID is optional, but if present, the tag can be easily controlled in scripts.
3. Members:
expires
Set or get the expiration date of data saved using userData behavior.
Script syntax: Object ID.expires = Parameter
The parameter is a string representing the expiration date in UTC (Universal Time Coordinate, World Adjustment Time) format. This property is readable and writable and has no default value. The browser will compare this date with the current date, and if it expires, the data will automatically expire.
getAttribute()
Get the specified attribute value.
load (storage area name)
Loads the stored object data from the UserData storage area.
removeAttribute()
Removes the specified attribute value from the object.
save (storage area name)
Save object data into a UserData storage area.
setAttribute()
Set the specified attribute value.
XMLDocument
Get the XML DOM reference that stores the object data.
For specific usage, please check MSDN (http://msdn.microsoft.com)
4. Example
Example 1: Application of text box mark (Microsoft)
The code is as follows: