java代碼
WVH5.getSettings().setJavaScriptEnabled(true);
WVH5.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
WVH5.requestFocus();
H5代碼:
$(document).on("pageinit","#test",function(){ $("#btnTest").on("tap",function(){ $(this).hide(); //Window.demo.clickOnAndroid(2); }); });</head>
<body>
<div data-role="page" id="test">
<div data-role="content">
<div id="btnTest">
<button>消失吧1</button>
</div>
</div>
</div>
</body>
單頁面還是頁面跳轉,如果頁面調整,jqm這麼寫pageinit是不起作用的。需要把script放在page裡面