How to open an external page in phonegap when clicking?

Asked

Viewed 734 times

0

Today I started developing using Phonegap, but I came across a problem, which is to click on a link and not be able to open an external page, as if it were a new Activity, how can I perform this procedure only using html,css and javascript ? Thanks in advance.

  • You want to open the page outside of Phonegap?

  • I want to open another screen in Phonegap itself, as if it was in Webview android that you can configure so when going to another page, it opens in the application itself.

1 answer

1


It is not advisable to open external pages within the Cordova application itself. If you need only open external pages, just call the device’s default browser by:

navigator.app.loadUrl("seuLink", { openExternal:true } );

In the latter case, if you really need to open an internal page in your Cordova/Phonegap App, try iframe. However, as said, this can cause a lot of problems in the way the App works (events of Backbutton, for example, may no longer function as expected).

PS: In addition, since Cordova 4.0, the standard plugin has been implemented Whitelist. You may need to configure the pages you will open in advance.

I hope it helps. :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.