Question

I'm having trouble understanding how to use the inApp Browser in Phonegap Build. My code looks like this: Javascript:

function appBrowse(url) {
         var ref = window.open(url, '_blank', 'location=yes');
         ref.addEventListener('loadstart', function() { alert('start: ' + event.url); });
         ref.addEventListener('loadstop', function() { alert('stop: ' + event.url); });
         ref.addEventListener('exit', function() { alert(event.type); });
    }

HTML:

<a href="" onClick="javascript:appBrowse('http://www.naturefund.de/erde/co2_rechner/co2_rechner_nahrung.html')">CO2 Rechner</a>

Is there anything else I need? I feel like I am missing something very basic. I added the plugin to my config.xml

Cheers

Was it helpful?

Solution 2

solved. In the end, just reinstalling the App worked. I assume that certain changes in the config.xml (like whitelisting a url, or adding a plugin) need a complete reinstall instead of just an update via Hydration.

OTHER TIPS

Which Cordova version do you use? If on version 3 did you add the plugin code to the project as well with $ cordova plugin add org.apache.cordova.inappbrowser ? Read up here: http://docs.phonegap.com/en/3.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top