Backbone.History.extend( { loadUrl: …} ) returning false for valid routes
问题 I'm trying to extend Backbone.History.loadUrl() to catch 404 errors: var History = Backbone.History.extend({ loadUrl: function() { var match = Backbone.History.prototype.loadUrl.apply(this, arguments); if (!match) { console.log('route not found'); } return match; } }); (Backbone.history = new History).start(); This is based on the solution suggested here: https://github.com/jashkenas/backbone/issues/308#issuecomment-9482299. The problem I'm encountering is that when I call (Backbone.history =