Created
April 19, 2012 13:45
-
-
Save tqc/2421059 to your computer and use it in GitHub Desktop.
Detect Phonegap / Cordova on startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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