Skip to content

Instantly share code, notes, and snippets.

@purdrew
Created May 29, 2012 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save purdrew/2830064 to your computer and use it in GitHub Desktop.
Save purdrew/2830064 to your computer and use it in GitHub Desktop.
Hello World Cordova
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" id="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<script type="text/javascript" src="cordova-1.8.0.js"></script>
<script type="text/javascript">
function deviceInfo() {
console.log('Cordova initialized');
document.getElementById('hello.cordova').innerHTML = 'Hello world from Cordova ' + device.cordova;
}
// register Cordova event listener for initialization complete
function init() {
console.log('In init()');
document.addEventListener('deviceready', deviceInfo, true);
}
</script>
<title>Hello Cordova</title>
</head>
<body onload="init()">
<h1 id='hello.cordova'>Initializing...</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment