2 var ask
= true; /*true改为false默认记住不询问*/
4 var allInput
= document
.querySelectorAll("input");
5 var allShownInput
= [];
8 for (var i
= 0; i
< allInput
.length
; i
++) {
9 if (allInput
[i
].offsetWidth
!= 0) {
10 if (allInput
[i
].hasAttribute("type")) {
11 if ((allInput
[i
].getAttribute("type") == "password") || (allInput
[i
].getAttribute("type") == "text"))
12 allShownInput
.push(allInput
[i
]);
14 allShownInput
.push(allInput
[i
]);
17 for (i
= 1; i
< allShownInput
.length
; i
++) {
18 if (allShownInput
[i
].type
== "password") {
19 pass
= allShownInput
[i
];
20 name
= allShownInput
[i
- 1];
24 if ((!pass
) || (!name
)) return;
27 if (!localStorage
.xxM_ifrm
) {
28 if (confirm("记住本站密码吗?")) { /*这里可以更改询问语句*/
29 localStorage
.setItem("xxM_ifrm", "true");
30 localStorage
.xxM_ifrm
= "true";
32 localStorage
.setItem("xxM_ifrm", "false");
36 if (localStorage
.xxM_ifrm
== "false") {
41 if (!localStorage
.xxM_name
) {
42 localStorage
.setItem("xxM_name", "");
43 localStorage
.setItem("xxM_pass", "");
45 name
.value
= localStorage
.xxM_name
;
46 pass
.value
= localStorage
.xxM_pass
;
47 name
.addEventListener("input", function () {
48 localStorage
.xxM_name
= name
.value
;
50 pass
.addEventListener("input", function () {
51 localStorage
.xxM_pass
= pass
.value
;