Reputation: 28208
Given:
super.app
web application powered by BackboneTom browses to products/1
page where a #special-offer
section exists.
Does Backbone allow Tom to share a link with Fred including the anchor to the special-offer section: http://super.app/products/1#special-offer
Will Fred be redirected to http://super.app/#products/1 (eg: without the #special-offer
)?
In other words, does Backbone allow to use anchors?
Upvotes: 4
Views: 5171
Reputation: 28208
I had a test here http://bl.ocks.org/abernier/raw/3183257/
It appears that YES:
http://bl.ocks.org/abernier/raw/3183257/product1.html#special-offer
http://bl.ocks.org/abernier/raw/3183257/#product1.html
eg: without #special-offer
The only thing I had to take care about was to disable anchors for hashes-based history browsers, by:
if (!Backbone.history._hasPushState) {
$('body').delegate('a[href^=#]', 'click', function (e) {
e.preventDefault();
});
}
Upvotes: 4