init
This commit is contained in:
57
Html-Javascript/39-浏览器对象补充.html
Normal file
57
Html-Javascript/39-浏览器对象补充.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>3秒后回归</h1>
|
||||
|
||||
<script>
|
||||
|
||||
// history
|
||||
// console.log(history);
|
||||
|
||||
// setTimeout(() => {
|
||||
// history.back(); // 回退
|
||||
// history.forward(); // 前进
|
||||
// }, 3000)
|
||||
|
||||
|
||||
// history.go(1); // 前进一个页面
|
||||
// history.go(0); // 刷新当前页面
|
||||
// history.go(-1); // 后退一个页面
|
||||
|
||||
|
||||
// 存储对象
|
||||
// localStorage 存字符串数据 存储时效 你不删我就在
|
||||
// sessionStorage 存字符串数据 页面关闭 我就清空
|
||||
|
||||
// 增 // 改
|
||||
// localStorage.setItem("key", "value");
|
||||
// localStorage.setItem("key", "change value");
|
||||
|
||||
|
||||
// 查
|
||||
// console.log(localStorage.getItem("key"));
|
||||
// console.log(localStorage.getItem("myData"));
|
||||
|
||||
// 删
|
||||
// 单数据 指的删除
|
||||
// localStorage.removeItem("key");
|
||||
|
||||
// 清空
|
||||
// localStorage.clear();
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user