Skip to content

Instantly share code, notes, and snippets.

@alexandernst
Created June 24, 2012 14:36
Show Gist options
  • Save alexandernst/2983461 to your computer and use it in GitHub Desktop.
Save alexandernst/2983461 to your computer and use it in GitHub Desktop.
Backbone Error 404
window.APP = Backbone.Router.extend({
initialize: function(){
this.route(/.*?/, "e404");
this.route(/^$/, 'mainPage');
//Some other routes
},
e404: function(){
console.log("Error 404!");
},
mainPage: function(){
console.log("Main page!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment