Search code examples
ioscordovaphonegap-pluginschildbrowser

Phonegap Childbrowser onLocationChanged (iOS)


I need the URL of the current childBrowser window.. I've tried with

function doThis(){
var location;
var cb = window.plugins.ChildBrowser;
cb.onLocationChange = function(loc){ location = loc; }
alert(location);
}

in my body

<a href="#" onclick="doThis()">Do this</a>

But whenever I add the line with cb.onLocationChange, my app doesn't respond anymore.. Any suggestions?


Solution

  • It should be

    cb.onLocationChange = function(loc){
        location = loc; 
        alert(location);
    }