fengchuanyu 8 mesi fa
parent
commit
e977ea0379
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      7_HTML5/6_cookie.html

+ 9 - 0
7_HTML5/6_cookie.html

@@ -17,6 +17,15 @@
         var resArr = document.cookie.split(";");
         console.log(resArr[1].split("=")[0]);
 
+        // 手动实现以下方法
+        setCookie(key,val,2);
+
+        getCookie(key);//返回一个cookie值
+
+        delCookie(key);//只需要将时间设置为过期时间
+
+
+
     </script>
 </body>
 </html>