Skip to content

Instantly share code, notes, and snippets.

@bFlood
Created October 23, 2014 13:06
Show Gist options
  • Save bFlood/c1f390def8f1a09c4d94 to your computer and use it in GitHub Desktop.
Save bFlood/c1f390def8f1a09c4d94 to your computer and use it in GitHub Desktop.
var _views = [];
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
steroids.logger.log("deviceready");
_views.push(createView("next", "next.html"));
$("#push").on("click", function() {
steroids.layers.push(_views[0]);
});
}
function createView(id, location){
var view = new steroids.views.WebView(options);
view.preload({id: id}, {
onSuccess: function() {
steroids.logger.log("preloaded view: " + id); //<-----this is called
},
onFailure: function() {
steroids.logger.log("failed to create view: " + id);
}
});
return view;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment