rcvc
rcvc

Reputation: 11

cordova inappbrowser doesn't load links inside app

I have an android app that when running loads an index.html on the server. This file redirects to another page:

window.open ('url', '_ blank', 'location = yes');

This page is loaded into the application and has a menu composed of <a> tags. When I click on a menu option it redirects me to other pages but loads them into the system browser and not into the app.

I installed the cordova-plugin-inappbrowser plugin.

I have tested <a> tags in the following ways:

echo "<a href=\"#\" onclick=\"window.open('"$url."','_ self','location=yes');\">Categ</a>";

echo "<a href=\"\" onclick=\"window.open('".$url."');\">Categ</a>";

echo "<a onclick=\"window.open('".$url."','_ self','location=yes');\">Categ</a>";

In the config.xml file I added:

<feature name="InAppBrowser">
    <param name="android-package" value="org.apache.cordova.InAppBrowser" />
</feature>

What am I doing wrong? I can not figure out why it does not load the menu pages into the app.

Upvotes: 0

Views: 1272

Answers (1)

krunal nanda
krunal nanda

Reputation: 235

window.open is no longer supported.

Try this.

var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');

Upvotes: 1

Related Questions