Skip to content

Instantly share code, notes, and snippets.

@Sequoia
Created September 29, 2011 21:37
Show Gist options
  • Save Sequoia/1252007 to your computer and use it in GitHub Desktop.
Save Sequoia/1252007 to your computer and use it in GitHub Desktop.
diff --git a/pagify.js b/pagify.js
index 051f1ce..577d798 100644
--- a/pagify.js
+++ b/pagify.js
@@ -23,7 +23,10 @@
// Run after loading if caching, otherwise run immediately
var runAfterLoading = function() {
self.switchPage = function(page) {
- page = page || window.location.hash.replace('#','');
+ if(!page){ //if there's no page selected, go back to the default
+ window.location.hash.replace('#','');
+ page = self.settings.default;
+ }
// Load page content from cache
if(self.settings.cache) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment