MUI 页面传值,因为用的是H5+ plus方法所以要在真机上才能测试出效果

页面a.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>
        <div class="class">
            <div class="class1" onclick="jump()">传参,传参,传参<br/>传参,传参,传参<br/>传参,传参,传参</div>
        </div>
        <script src=" js/mui.min.js "></script>
        <script type="text/javascript ">
            mui.init();
            var newid = 5;

            function jump() {
                mui.openWindow({
                    id: "yingshou",
                    url: "b.html",
                    extras: {
                        a: 1,
                        b: 2,
                        c: 3,
                        d: 888
                    }
                })
            }
        </script>
    </body>

</html>

页面b.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><br /><br /><br /><br />
        <a href="a.html">
            << 返回 </a><br /><br /><br /><br />
            <div id="v"></div>
                <script src="js/mui.min.js"></script>
                <script type="text/javascript">
                    mui.init();
                    mui.plusReady(function() {
                        var self = plus.webview.currentWebview();
                        var a = self.a;
                        var b = self.b;
                        var c = self.c;
                        var d = self.d;
                        document.getElementById("v").innerHTML = a + " : " + b + " : " + c + " : " + d;
                    });
                </script>
    </body>

</html>

测试过完全可用。

posted @ 2017-11-15 14:40  AlbertSmith  阅读(338)  评论(0编辑  收藏  举报