Skip to content

Instantly share code, notes, and snippets.

@dhavaln
Created July 7, 2012 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhavaln/3064728 to your computer and use it in GitHub Desktop.
Save dhavaln/3064728 to your computer and use it in GitHub Desktop.
Simple Database Test
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="lib/android/cordova-1.7.0.js"></script>
<script type="text/javascript">
var dbCreated = false;
document.addEventListener("deviceready",
function() {
alert('1');
db = window.openDatabase("testproject", "1.0", "PhoneGap Test",
200000);
alert('2');
if (dbCreated) {
alert('3');
db.transaction(getData, transaction_error);
} else {
alert('4');
db.transaction(populateDB, transaction_error,
populateDB_success);
}
}, false);
function getData() {
}
function transaction_error() {
}
function populateDB(tx) {
}
function populateDB_success() {
}
</script>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment