Created
July 1, 2011 10:38
-
-
Save andrewcrook/1058283 to your computer and use it in GitHub Desktop.
sammy.js redirect problem
This file contains hidden or 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
var app = $.sammy( function() { | |
this.get('#/', function() { | |
$('#main').html('nothing to see here!'); | |
}); | |
this.get('#/test', function() { | |
$('#main').html('worked'); | |
}); | |
}; | |
$( function() { | |
$('#button').live('click', function(e) { | |
// window.location = '#/test' << Hack that works | |
// following fails "redirect is not a function" | |
app.redirect('#/test'); | |
}; | |
app.run('#/'); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try this -
var self,
app = $.sammy( function() {
this.get('#/', function() {
self=this;
$('#main').html('nothing to see here!');
});
.....
//app.redirect('#/test');
self.redirect('#/test');