Ajouve
Ajouve

Reputation: 10049

external link phonegap

When I inster an external link on my app I'm using

window.open('http://www.google.com', '_blank', 'location=yes');

But I have some feeds and for exemple I have full text paragraphs with links inside

<a href="http://www.google.com" >Google</a>

When I open a link like that and I come back in the application the css and the js are not loaded.

I'd like to open my links like in the first exemple, is there a solution ?

Thanks

Upvotes: 0

Views: 509

Answers (2)

Manish Kumar
Manish Kumar

Reputation: 1062

You can use the onclick event to open the childbrowser on anchor tags.

<a href="#" onclick="openInAppBrowser('http://google.com');">Google</a>

(Pass the Url as parameter to the function)

and in the javascript make a function like this

function openInAppBrowser(url){
  window.open(url, '_blank', 'location=yes');
}

Upvotes: 1

NDakotaBE
NDakotaBE

Reputation: 161

Are you using jQuery Mobile? If so, try using the tag below:

 <a href="http://www.google.be/" rel="external">Google</a>

Upvotes: 0

Related Questions