Created
September 17, 2013 06:38
-
-
Save RhinoLance/6590770 to your computer and use it in GitHub Desktop.
DeviceReady call for Cordova / Phonegap
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
$(document).ready(function () { | |
if (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1) { | |
document.addEventListener("deviceready", OnLoad, true); | |
} | |
else { | |
OnLoad(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An alternative: