JS实现两周内自动登录功能
作者:xing.org1^ 时间:2023-08-04 21:20:57
本文实例为大家分享了Android九宫格图片展示的具体代码,供大家参考,具体内容如下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>两周内自动登录</title>
<script src="cookie.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<form action="" method="post" id="form1">
<input type="text" name="user" id="user" value="" />
<input type="password" name="pass" id="pass" value="" />
<input type="submit" value="提交" id="btn"/>
<input type="checkbox" name="checkbox" id="checkbox" value="" />两周内自动登录
</form>
</body>
<script type="text/javascript">
var oTxt1 = document.getElementsByName('user')[0],
oTxt2 = document.getElementsByName('pass')[0],
cked = document.getElementsByName('checkbox')[0],
oForm1 = document.getElementById('form1'),
oBtn = document.getElementById('btn');
oForm1.onsubmit = function(){
if(cked.checked){
alert('请注意!您已勾选自动登录。为了保护您的账号安全,请不要在公共电脑上这样做。')
setCookie('user',oTxt1.value,14);
setCookie('pass',oTxt2.value,14);
}
}
oTxt1.value = getCookie('user');
oTxt2.value = getCookie('pass');
</script>
</html>
来自智能社的学习笔记延伸练习。
标签:js,自动登录
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python 字符串处理特殊空格\\xc2\\xa0\\t\\n Non-breaking space
2022-03-09 19:20:16
![](https://img.aspxhome.com/file/2023/2/107592_0s.png)
mysql 5.7.18 Archive压缩版安装教程
2024-01-16 03:05:35
![](https://img.aspxhome.com/file/2023/3/105213_0s.png)
Python IDLE Subprocess Connection Error的简单解决方法
2022-12-15 04:31:09
![](https://img.aspxhome.com/file/2023/0/103470_0s.png)
Python 统计Jira的bug 并发送邮件功能
2021-03-24 05:44:24
![](https://img.aspxhome.com/file/2023/3/83783_0s.jpg)
[译]开发人员经常犯的8个设计错误
2008-02-01 12:28:00
![](https://img.aspxhome.com/file/uploadpic/20082/1/200821125136512.gif)
一些相见恨晚的 JavaScript 技巧
2024-04-18 10:10:53
写给新手同学的vuex快速上手指北小结
2024-04-27 16:03:33
Django Admin后台模型列表页面如何添加自定义操作按钮
2021-02-24 18:57:15
![](https://img.aspxhome.com/file/2023/7/131557_0s.png)
Python使用matplotlib实现的图像读取、切割裁剪功能示例
2021-12-14 11:04:49
![](https://img.aspxhome.com/file/2023/7/114637_0s.png)
详解Django中六个常用的自定义装饰器
2021-02-10 03:03:09
python使用RNN实现文本分类
2023-10-17 14:07:18
![](https://img.aspxhome.com/file/2023/1/96461_0s.jpg)
Vue前端判断数据对象是否为空的实例
2024-05-02 16:53:14
![](https://img.aspxhome.com/file/2023/4/130154_0s.jpg)
详解OpenCV中简单的鼠标事件处理
2023-01-04 12:16:01
![](https://img.aspxhome.com/file/2023/7/78657_0s.jpg)
Python数据可视化之Seaborn的使用详解
2022-10-25 21:57:31
![](https://img.aspxhome.com/file/2023/2/89292_0s.png)
Python入门_浅谈数据结构的4种基本类型
2021-01-11 19:12:28
详解如何让Go语言中的反射加快
2024-05-28 15:36:52
python3 selenium自动化测试 强大的CSS定位方法
2021-09-13 01:41:13
Python中requests库的学习方法详解
2022-10-13 07:32:36
![](https://img.aspxhome.com/file/2023/5/134835_0s.png)
Python+Opencv实现计算闭合区域面积
2023-03-17 03:02:44
![](https://img.aspxhome.com/file/2023/1/92491_0s.png)
pycharm 实现光标快速移动到括号外或行尾的操作
2023-07-17 19:52:31