简体   繁体   中英

How to open mobile browser on Javascript?

How to open mobile browser on javascript?

I have an App. I want to open a link to the external browser.

Here's the code that I did:

window.open('www.twitter.com,', '_blank');

But it's not working.

Here's some additional code:

function(e)
{
navigator.notification.alert(
    'Please login to Twitter to share your score.',// message
        function()
        {
         window.open('www.twitter.com,', '_blank');
        },// callback
        'Twitter Login',// title
        'Ok'// buttonName
         );
})

Thanks in advance!

Set your target to _system

window.open("https://www.facebook.com", "_system");

If that doesn't work try the standard _blank .

window.open("https://www.facebook.com", "_blank");

I used this in my PhoneGap app and it works for me

window.open('http://192.168.1.140/meplan/uploads/ielts-writing-prepositions.pdf', '_blank');

// use your facebook url it will work

You can see the Phonegap documentation here that might be helpful to you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM