Skip to content

Instantly share code, notes, and snippets.

@filmaj
Created July 2, 2012 08:05
Show Gist options
  • Save filmaj/3031791 to your computer and use it in GitHub Desktop.
Save filmaj/3031791 to your computer and use it in GitHub Desktop.
global scope hurray
<html>
<head>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="mysqliteplugin.js"></script>
<script type="text/javascript">
var db; // this is now globally-scoped
document.addEventListener('deviceready', function() {
db = new sqliteplugin(); // assigns to the db variable above
});
</script>
</head>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment