Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2014 20:29
What would you like to do?
Detecting Apache Cordova using both window.cordova and 'deviceready' event
<!DOCTYPE html>
<title>Device Ready Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
var isCordovaApp = (typeof window.cordova !== "undefined");
if(isCordovaApp) {
document.addEventListener("deviceready", loadProject, false);
} else {
function loadProject() {
//Load project code here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment