Reputation: 4278
I have a link that I typically would have href="#". I would like the url to stay the same when it is clicked, but it seems like backbone copies and pastes the link to the URL no matter what it is. I even put
<a href="javascript:alert('true')>Link</a>
and the browsers URL was "localhost:5000/javascript:alert('true').
How can I get backbone to refrain from copy and pasting the link to the broswers URL
Upvotes: 1
Views: 293
Reputation: 35760
This is one of those "it's a feature not a bug" type of things. Backbone does that on purpose, for (at least) two reasons:
There's probably other reasons too, but that's all I can think of at the moment. The point is, this is what the Backbone router is supposed to do. Using it, and then wondering how to make it not manipulate the URL is somewhat akin to using an <span>
on the page and asking how to get let the user edit its text.
If you don't want that functionality, don't use the Router at all; just have your views invoke each other.
Upvotes: 1