js-cookie的使用

1.js-cookie的赋值

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
</head>
    <script type="text/javascript">
        document.cookie="user="+encodeURIComponent('小张'); 
        alert(decodeURIComponent(document.cookie));      //解决传输乱码问题
    </script>
<body>

</body>
</html>
posted @ 2022-12-06 22:23  轻风细雨_林木木  阅读(34)  评论(0编辑  收藏  举报