Skip to content

Instantly share code, notes, and snippets.

@macdonst macdonst/index.html Secret
Created May 26, 2011

Embed
What would you like to do?
Example of how to use the ChildBrowser in Android
<!DOCTYPE html >
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no" />
<meta name="format-detection" content="telephone=yes" />
<title>Test App</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script>
<script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>
<script language="text/javascript" type="text/javascript">
/**
* Called when initial web page is loaded
*/
function onBodyLoad()
{
console.log("onBodyLoad()");
// Listen for PhoneGap framework to finish init
document.addEventListener("deviceready",onDeviceReady,false);
}
/**
* When this function is called, PhoneGap has been initialized and is ready to roll
*/
function onDeviceReady() {
console.log("onDeviceReady()");
}
</script>
</head>
<body onload="onBodyLoad();">
<a href="#" onclick="window.plugins.childBrowser.showWebPage('http://www.google.com');">Open Google.com in child browser</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.