admin管理员组文章数量:1394051
I'm making this app on PhoneGap which contains a Map. On the standard Google Map, it has a "Terms of use" on the bottom right. If I click this, a whole new screen opens up. But I can't use the integrated Android Backbutton.
What do I do?
Somewhere else in the project I've used this (underneath this) javascript to get back to the previous screen - but since the "Terms of Use" screen isn't a JS-file, how do I tell it what it can/cannot do (go back to previous screen) ?
document.addEventListener("backbutton", function(e){
e.preventDefault();
navigator.app.backHistory();
}, true);
I'm making this app on PhoneGap which contains a Map. On the standard Google Map, it has a "Terms of use" on the bottom right. If I click this, a whole new screen opens up. But I can't use the integrated Android Backbutton.
What do I do?
Somewhere else in the project I've used this (underneath this) javascript to get back to the previous screen - but since the "Terms of Use" screen isn't a JS-file, how do I tell it what it can/cannot do (go back to previous screen) ?
document.addEventListener("backbutton", function(e){
e.preventDefault();
navigator.app.backHistory();
}, true);
Share
Improve this question
edited Dec 29, 2013 at 6:20
Kara
6,22616 gold badges53 silver badges58 bronze badges
asked Feb 14, 2013 at 8:47
RadRad
8301 gold badge12 silver badges24 bronze badges
1 Answer
Reset to default 9If you are still having this problem. My solution was to capture the click event to the links in the map canvas, prevent default, get the links url, then open the url in the InAppBrowser.
$('#map_canvas').on('click', 'a', function(e){
e.preventDefault();
window.open($(this).attr('href'), '_blank');
});
http://docs.phonegap./en/2.7.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser
本文标签: javascriptPhoneGapHow to get back when Google Maps quotTerms of usequot is pressedStack Overflow
版权声明:本文标题:javascript - PhoneGap - How to get back when Google Maps "Terms of use" is pressed? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744087859a2588866.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论