View Full Version : ChildBrowser + Cordova 1.7 errors please help - not an object

05-31-2012, 12:35 AM
Hi, I am trying to follow this tutorial:
PhoneGap Tutorial Series #4 Third-Party Plugins (ChildBrowser) Hiedi Utley (http://hiediutley.com/2011/03/30/phonegap-tutorial-series-4-using-a-third-party-plugin/)

I am basically trying to link to a child browser as you can see my link below... I have included all relevant files etc

I get the error message: "TypeError: childBrowser is undefined"

<script type="text/javascript" charset="utf-8" src="ChildBrowser.js"></script>
<script type="text/javascript" charset="utf-8">
var childBrowser;
function onBodyLoad()
/* PhoneGap has been initialized and is ready to roll */
function onDeviceReady()
var phoneGapReady;
phoneGapReady.innerHTML = "PhoneGap is Ready";
childBrowser = ChildBrowser.install();
function openChildBrowser(url)
try {
//both of these should work...
catch (err)
<button onclick="openChildBrowser(\'http://www.google.com\')">Open Google</button>

Old Pedant
05-31-2012, 01:10 AM

Because you do this:

var phoneGapReady;
phoneGapReady.innerHTML = "PhoneGap is Ready";
childBrowser = ChildBrowser.install();

BUT YOU GET AN ERROR on the line in red!

YOU NEVER defined what in the banana pudding the variable phoneGapReady is supposed to point to!

So you tried assigning to the innerHTML of a null variable!

And when you get the error on the red line, you NEVER GET to the line that does the install!!


And, please, do NOT double post!

05-31-2012, 01:11 AM
What I understand from the tutorial page is, that ChildBrowser is a sub-plugin to Phonegap,
and thus also required a phoneGap.version.js in order to work, though obviously no direct error is thrown if ommited.

In your code your haven't called any version of PhoneGap.

Old Pedant
05-31-2012, 01:15 AM
Good catch, Lerura. Though that would then presumably give a different error message out of the ChildBrowser library code. The reason for the error he was getting is simply because he never was even calling the install function.