Use ie userdata behavior as a client-side Data Storage

Source: Internet
Author: User

I described how to use jstore as a client-side persistent storage in my last post. the jstore manage a number of different storage engines, such as gears and flash objects. but they all need additional downloads.

The IE browser has provide a mechanic called userdata behavior to store Max 128kb data a page, 1024kb a domain. this is a portion of DHTML that suppoted by ie5 or later. refer to this article: userdata behavior.

The userdata behavior is much like what Cookie does, but it supply a much bigger storage. the data is stored in the C: \ Documents ents and Settings \ User Name \ userdata \ folder, which will be visible even if you refresh the page or re-open the IE browser. the data will always exist, unless you delete it manually or set the expire date.

Here is an example:

 
$ (function () {

var userdata = $ ('# userdata') [0];


$ ('# getdata '). click (function () {
$ ('# data '). val ('');
userdata. load ('My _ user_data_storage ');
$ (' # data '). val (userdata. getattribute ('data _ 1');

});


$ ('# savedata '). click (function () {
userdata. setattribute ('data _ 1', $ ('# data '). val ();
userdata. save ('My _ user_data_storage ');

});






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.