Create a gist now

Instantly share code, notes, and snippets.

@versluis /index.html
Last active Dec 24, 2015

PhoneGap Starter Template
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- tells the device browser not make phone numbers clickable -->
<meta name="format-detection" content="telephone-no">
<!-- several things are going on here:
- first we'll make sure the user can't pinch or zoom
- we'll set the "browser" to full screen
- and we'll make sure retina devices work without scaling the content
-->
<meta name="viewport" content="user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi">
<!-- the title is not dispayed so it doesn't matter -->
<title>PhoneGap Starter</title>
<!-- link to our own custom style sheet -->
<link rel="stylesheet" href="css/stylesheet.css">
<!-- and link to appropriate PhoneGap library - replace accordingly -->
<script src="cordova.ios.js"></script>
<!-- these scripts could be put into a separate js file, according to taste -->
<script>
// check if the device is ready - and if it is, call onDeviceReady
function init() {
document.addEventListener("deviceready", onDeviceReady, false);
}
// called from the above when device is ready
// your entire app goes goes inside this function
function onDeviceReady() {
alert('PhoneGap is ready for business!');
}
</script>
</head>
<!-- when our document loads, the first thing we'll do is kick off this function -->
<body onload="init()">
<div>Content displayed by our app</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment