Mui-自定义事件跳转带参数
---event.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="mui-content"> <ul class="mui-table-view" id="lists"> <li class="mui-table-view-cell" id="1">列表一</li> <li class="mui-table-view-cell" id="2">列表一</li> <li class="mui-table-view-cell" id="3">列表一</li> </ul> </div> <script src="js/mui.min.js"></script> <script type="text/javascript"> mui.init(); /*真机环境下运行调试*/ mui.plusReady(function(){ /*进行预加载,用户没有点击是就已经加载完成*/ var prPage = mui.preload({url:'info.html',id:'info.html'}); mui('#lists').on('tap','li',function(){ mui.fire(prPage,'newsinfoEvent',{'title':this.innerHTML},{'id':this.getAttribute('id')}); mui.openWindow({url:'info.html',id:'info.html'}); }); }); </script> </body> </html>
---info.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> <header class="mui-bar mui-bar-nav"> <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> <h1 class="mui-title" id="title1"></h1> </header> <div class="mui-content"> </div> <script src="js/mui.min.js"></script> <script type="text/javascript"> mui.init(); mui.plusReady(function(){ window.addEventListener('newsinfoEvent',function(e){ var title1 = mui('#title1'); title1[0].innerHTML = e.detail.title; mui.toast(e.detail.id); }); }); </script> </body> </html>