码迷,mamicode.com
首页 > Web开发 > 详细

JS---使用localStorage传递参数

时间:2018-05-31 00:24:25      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:get   java   htm   ble   页面   sheet   type   item   nim   

localStorage_send_page.html(发送页面)

<!doctype html>
<html>

    <head>
        <meta charset="UTF-8">
        <title></title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="css/mui.min.css" rel="stylesheet" />
    </head>

    <body>
        <button type="button" class="mui-btn mui-btn-red">用localStorage向recieve_page页面传值</button>
        <script src="js/mui.min.js"></script>
        <script type="text/javascript">
            mui.init();
            //localStorage
            document.getElementsByTagName(button)[0].addEventListener(tap, function() {
                localStorage.setItem(name, Harden);
                window.location.href = localStorage_recieve_page.html;
            });
        </script>
    </body>

</html>

 

localStorage_recieve_page.html(接收页面)

<!doctype html>
<html>

    <head>
        <meta charset="UTF-8">
        <title></title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="css/mui.min.css" rel="stylesheet" />
    </head>

    <body>
        <button type="button" class="mui-btn mui-btn-red">用localStorage向recieve_page页面传值</button>
        <script src="js/mui.min.js"></script>
        <script type="text/javascript">
            mui.init();
            //localStorage
            document.getElementsByTagName(button)[0].addEventListener(tap, function() {
                localStorage.setItem(name, Harden);
                window.location.href = localStorage_recieve_page.html;
            });
        </script>
    </body>

</html>

 

JS---使用localStorage传递参数

标签:get   java   htm   ble   页面   sheet   type   item   nim   

原文地址:https://www.cnblogs.com/beast-king/p/9113869.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!