Skip to content

Instantly share code, notes, and snippets.

@willkoper
Created August 29, 2012 16:02
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 willkoper/3514870 to your computer and use it in GitHub Desktop.
Save willkoper/3514870 to your computer and use it in GitHub Desktop.
Cordova js excerpt
function onDeviceReady(){
if(window.location.hash){
//resuming from saved state
getPhoto("resume");
function getPhoto (source){
//callbacks defined within this function
if(source === "resume"){
//execute cb based on saved instance
//there was an if(window.cordova) here, but I removed since it's running in the onDeviceReady func.
alert("Resuming from saved state! Woohoo!");
cordova.callbacks["Camera"] = {
success : onSuccess,
fail : onFail
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment