-
-
Save macdonst/ffb9651d04155e4f442f to your computer and use it in GitHub Desktop.
Example of how to use the ChildBrowser in Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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