mui页面跳转(传值+接收)

<script type="text/javascript" charset="utf-8">
         mui.init();
         mui.plusReady(function() {       
             document.getElementById("test").addEventListener("tap", function() {
                 mui.openWindow({
                     url: "search.html",
                     id: "search",
                     waiting: {
                         autoShow: false
                     },
                      extras:{
                       name:'testapp'
                     }
                 });
             
             });
         });
     </script>
     <a  id="test"> 跳转 search.html </a>
     接收
     <script type="text/javascript" charset="utf-8">
         mui.init();
         //B页面onload从服务器获取列表数据;
         window.onload = function(){  //可省略
             //从服务器获取数据
             //业务数据获取完毕,并已插入当前页面DOM;
             //注意:若为ajax请求,则需将如下代码放在处理完ajax响应数据之后;
             mui.plusReady(function(){
                 var self = plus.webview.currentWebview();
                 var name = self.name;
                 console.log(name);
                 //关闭等待框
                 plus.nativeUI.closeWaiting();
                 //显示当前页面
                 mui.currentWebview.show();
             });
         }
     </script>

mui

相关推荐