Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

target ="_blank" not working in IOS

I am developing mobile app(IOS/android) UI with phonegap/cordova 2.1.0. I want to open a link given in href attribute of anchor tag in a new window/page. I tried :

target="_blank"

But it is not working in IOS. Any workaround available?. Thanks

like image 577
clint Avatar asked Nov 04 '22 11:11

clint


1 Answers

If you can use JQuery :

<a href="http://link.com" rel="external">link</a>

Javascript :

$(document).ready(function(){
    $('a[rel="external"]').click(function() {
        window.open($(this).attr('href'));
        return false;
    });
});

Sources

like image 53
MyBoon Avatar answered Nov 12 '22 18:11

MyBoon