3

I am developing android hybrid app using the backbone js framework. Does anyone know how to log or alert backbone history stack items in jquery or javascript?

Backbone.history function in backbone js.

Help appreciated.

Thanks

Nagendra Badiganti
  • 2,099
  • 2
  • 22
  • 30

1 Answers1

3

You can do this by overriding Backbone.history.navigate method:

var history = [];
var originalNavigate = Backbone.history.navigate;
Backbone.history.navigate = function (fragment) {
  history.push(fragment);
  return originalNavigate.apply(this, arguments);
}

All navigation history will be stored in the history array.

Vitalii Petrychuk
  • 14,035
  • 8
  • 51
  • 55