PhoneGap: Open external link in default browser (outside the app)

前端 未结 16 1781
我在风中等你
我在风中等你 2020-12-09 15:36

I\'m trying to open links in Safari (on an iPhone) from a PhoneGap application. I\'m using PhoneGap version 3.1.0, and use PhoneGap Build, to build the application.

16条回答
  •  臣服心动
    2020-12-09 16:15

    How about this?

    Test link 2
    

    EDIT:

    This may pertain: How to call multiple JavaScript functions in onclick event?

    I was thinking, how about this:

    Add to code:

    $(".navLink").on('tap', function (e) {
        //Prevents Default Behavior 
        e.preventDefault();
        // Calls Your Function with the URL from the custom data attribute 
        openUrl($(this).data('url'), '_system');
    });
    

    then:

    Go to Google
    

提交回复
热议问题