最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to remove the # in Backbone.js URL's - Stack Overflow

programmeradmin2浏览0评论

I am new to Backbone.js, still learning it and 1 problem I have run into is a lot of resources online are outdated and things have changed in Backbone.js since the time the resources were created.

What I am confused about is I have seen some tutorials that have nice clean urls like this domain/useer/add but more often I am seeing domain/#useer/add

So my question is, does Backbone enable you to do the URL's like this domain/useer/add without the # or does that require another library?

I am new to Backbone.js, still learning it and 1 problem I have run into is a lot of resources online are outdated and things have changed in Backbone.js since the time the resources were created.

What I am confused about is I have seen some tutorials that have nice clean urls like this domain./useer/add but more often I am seeing domain./#useer/add

So my question is, does Backbone enable you to do the URL's like this domain./useer/add without the # or does that require another library?

Share Improve this question asked Jun 2, 2013 at 15:45 JasonDavisJasonDavis 49k107 gold badges326 silver badges559 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

you can set pushState = true like this.

Backbone.history.start({ pushState: true })

take a look at this link for more details. http://artsy.github.io/blog/2012/06/25/replacing-hashbang-routes-with-pushstate/

发布评论

评论列表(0)

  1. 暂无评论