Answer the question
In order to leave comments, you need to log in
How to prevent navigation through Backbone.js anchors?
In the address bar, the value changes, in the console the link is displayed correctly, but the transition does not occur
. Here is my attempt:
$(document).on('click', 'a[href^="#"]', function (e) {
e.preventDefault();
var link = this.hash.substr(1);
console.log(link);
Backbone.history.navigate(link);
});
routes: {
'': 'viewData',
'collections': 'viewCollections',
'databases': 'databases'
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question