获取当前页面的webview ID
代码: A页面 <script type="text/javascript"> var ws = null; mui.plusReady(function(){ ws = plus.webview.currentWebview(); ws.id = 'index'; // console.log(ws.id); }); mui("body").on("tap", "a", function() { var id = this.href; mui.openWindow({ id: id, url: id, styles: 'webview_style', extras:{ pageId:ws.id //扩展参数 }, show: { aniShow: 'pop-in' } }); }); </script> B页面 <script type="text/javascript"> mui.plusReady(function(){ var ws = plus.webview.currentWebview(); var page = plus.webview.getWebviewById(ws.pageId); console.log(page); }); </script> 打出log后page为null
侵删 联系614506425@qq.com