mui傳值,使用mui.openWindow()實現,參數extras傳入參數,被傳入的頁面用plus接收即可 ...
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>