Localstorage Save account password

Source: Internet
Author: User

The first is to determine whether the browser supports this attribute, which is the attribute in HTML5:

if (window.localstorage) {
Alert (' Support ');
}else{
Alert (' not supported ');
}

Localstorage.a = 3;// set a to "3"
Localstorage["a"] = "SFSF";// set a to "SFSF", overriding the above value
Localstorage.setitem ("B", "Isaac");// set b to "Isaac"
var A1 = localstorage["A"];// gets the value of a
var a2 = localstorage.a;// gets the value of a
var B = Localstorage.getitem ("b");/ / get the value of B
Localstorage.removeitem ("C");/ / clears the value of C

And then just enter the login page to populate

if (localstorage.key_id && localstorage.username)
{
$ ("#login_merchant_id"). Val (localstorage.key_id);
$ ("#login_username"). Val (Localstorage.username);
} ;

Save when the account password is correct

localstorage.key_id = Key_uni;
Localstorage.username = Username;

Localstorage Save account password

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.