Skip to content

Instantly share code, notes, and snippets.

@tqc
Created April 19, 2012 13:45
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 tqc/2421059 to your computer and use it in GitHub Desktop.
Save tqc/2421059 to your computer and use it in GitHub Desktop.
Detect Phonegap / Cordova on startup
if (document.location.protocol == "file:") {
// file protocol indicates phonegap
document.addEventListener("deviceready",
function() { $(initInternal);}
, false);
}
else {
// no phonegap, start initialisation immediately
$(initInternal);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment