jarv
05-30-2012, 11:35 PM
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()
{
document.addEventListener("deviceready",onDeviceReady,false);
}
/* 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...
//window.plugins.childBrowser.showWebPage(url);
childBrowser.showWebPage(url);
}
catch (err)
{
alert(err);
}
}
</script>
<button onclick="openChildBrowser(\'http://www.google.com\')">Open Google</button>
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()
{
document.addEventListener("deviceready",onDeviceReady,false);
}
/* 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...
//window.plugins.childBrowser.showWebPage(url);
childBrowser.showWebPage(url);
}
catch (err)
{
alert(err);
}
}
</script>
<button onclick="openChildBrowser(\'http://www.google.com\')">Open Google</button>