温泉ui滑动菜单 - html <a> tag to weblink - android back button press don&#39;t go back

时间:2015-07-01 06:19:18

标签: cordova onsen-ui

I have tested without using onsen ui sliding menu template, with a simple html page. it is OK, I touch the link and browse and can go back by pressing android back button. But, in sliding menu template, I create link, press and go into the weblinks and cannot back and exit the app. Please help me solve the problem. Thanks!

1 个答案:

答案 0 :(得分:0)

我不确定,但我认为你应该尝试使用这个插件。

InAppbrower

这是一个例子..

HTML

<a href="" onclick="popupInAppBrowser('https://www.google.com')">GOOGLE</a>

JS

function popupInAppBrowser(url) {

   var ref = window.open(url, '_blank', 'closebuttoncaption=Close,location=yes,transitionstyle=coverhorizontal,toolbarposition=top,clearcache=no,clearsessioncache=no');

   ref.addEventListener("exit", function () {
     ref.close();
   });

   ref.show();
}