mui页面跳转(传值+接收)
1 <script type="text/javascript" charset="utf-8"> 2 mui.init(); 3 mui.plusReady(function() { 4 document.getElementById("test").addEventListener("tap", function() { 5 mui.openWindow({ 6 url: "search.html", 7 id: "search", 8 waiting: { 9 autoShow: false 10 }, 11 extras:{ 12 name:'testapp' 13 } 14 }); 15 16 }); 17 }); 18 </script> 19 <a id="test"> 跳转 search.html </a> 20 接收 21 <script type="text/javascript" charset="utf-8"> 22 mui.init(); 23 //B页面onload从服务器获取列表数据; 24 window.onload = function(){ //可省略 25 //从服务器获取数据 26 //业务数据获取完毕,并已插入当前页面DOM; 27 //注意:若为ajax请求,则需将如下代码放在处理完ajax响应数据之后; 28 mui.plusReady(function(){ 29 var self = plus.webview.currentWebview(); 30 var name = self.name; 31 console.log(name); 32 //关闭等待框 33 plus.nativeUI.closeWaiting(); 34 //显示当前页面 35 mui.currentWebview.show(); 36 }); 37 } 38 </script>