Cordova Phonegap and Google Maps v3 javascript api: How to add backbutton functionality when clicking either the license link or the Google maps logo

后端 未结 3 2039
囚心锁ツ
囚心锁ツ 2021-01-13 09:39

Background: The Cordova phonegap 2.2 application running on Android allows listening to the backbutton event

document.addEventListener(\"bac         


        
3条回答
  •  不思量自难忘°
    2021-01-13 10:02

    $(document).on('click', '#map a[target="_blank"]', function(e){
        e.preventDefault();
        var url = $(this).attr('href');
    
        if( /Android/.test(navigator.appVersion) ){
            navigator.app.loadUrl(url, { openExternal:true });
        }else{
            window.open(url, '_system');
        }
    });
    

    #map - google maps container

    Work both for android and ios.

提交回复
热议问题