I have this issue with that when I click on anchors, that the page reloads, which I want to avoid even though I'm using pushstate:true
So, inside my main.js I have:
Backbone.history.start({ pushState: true, root: App.ROOT });
$(document).on('click', 'a:not([data-bypass])', function (evt) {
var href = $(this).attr('href');
if (href && href.indexOf('#') === 0) {
evt.preventDefault();
Backbone.history.navigate(href, true);
}
});
So, I tried to change it like mentioned here Preventing full page reload on Backbone pushState - but without success.
I'm using BackboneJS
, NodeJS
and HandlebarsJS
Is there any solution to this?