So I'm setting up the Child Browser plugin in Xcode for my phonegap app and was having some issues with it. First off, just to make sure its structured correctly in Xcode, I have all the native files in my plugins folder along with ChildBrowser.bundle
for the icons.
Now for the html side, I have a my cordova.js
and childbrowser.js
files in my head followed by this
<script type="text/javascript">
function onDeviceReady() {
var root = this;
cb = window.plugins.childBrowser;
if(cb != null) {
cb.onLocationChange = function(loc){ root.locChanged(loc); };
cb.onClose = function(){root.onCloseBrowser(); };
cb.onOpenExternal = function(){root.onOpenExternal(); }
}
}
function onCloseBrowser() {
console.log("onCloseBrowser!");
}
function locChanged(loc) {
console.log("locChanged!");
}
function onOpenExternal() {
alert("onOpenExternal!");
}
</script>
Then for my <a>
tag I used the onClick event that is used in the github example Here
<a onclick="childBrowser.showWebPage('http://google.com');" href="#">Test</a>
But when I try it in the simulator, nothing really happens and the consol log doesn't even show any activity. I'm I doing this right or what? Any help is appreciated. Im using phonegap 2.6.0