I have some routes:
routes: {
"": "main",
"!/": "main",
"!/page": "page",
"!/page/:id": "page"
},
Then I have some html link, for example:
<a href="site.com/#!/page/3">my link</a>
If i press to my link I access to url site.com/#!/page/3 and it's ok for me. But if I have this link:
<a href="javascript:void(0);" onclick="Backbone.history.navigate('!/page/3', {trigger:true});">my link</a>
I access to url site.com/#!/page/ (without id=3). Id is still defined. But after page reloading, I have a problem with my ID, because I have url: site.com/#!/page, and ID is not defined.
How can I navigate in Backbone with the following link tag?
<a href="javascript:void(0);" onclick="Backbone.history.navigate('!/page/3', {trigger:true});">my link</a>