Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:36:02+00:00 2026-05-23T11:36:02+00:00

I saw the latest backbone.js (0.5) introduced the pushState option for routing. After reading

  • 0

I saw the latest backbone.js (0.5) introduced the pushState option for routing.

After reading through https://developer.mozilla.org/en/dom/manipulating_the_browser_history
I have to say it is not very clear to me : what pushState is and what exactly it is that pushState brings, in the context of writing a web app with backbone; is it for :

  • improving urls: to have a ‘real’, bookmarkable, ‘server-reachable’ url, as opposed to hashes?

  • graceful degradation: allow the server to render correct pages without JS enabled ?

  • both/none of the above, or other reasons ?

Also, what am i doing wrong below ?:

class MyRouter extends Backbone.Router
  routes :
    ''       : 'index'
    '#hello' :'hello'

  index : -> console.log 'index'
  hello: -> console.log 'hello'

new MyRouter

Backbone.history.start pushState: true

When I navigate to http://localhost#hello, the url is changed to http://localhost/#hello, but the callback is not fired ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:36:03+00:00Added an answer on May 23, 2026 at 11:36 am

    You don’t need the # prefix in your routes table. Try this:

      routes :
        ''       : 'index'
        'hello'  : 'hello'
    

    As for pushState I think its both of the above. It does mean more work on the server-side than you would have to do with location hash because you are going to have to make sure that your server can serve pages for all those URLs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded the latest version of JQM and saw jquery.mobile.structure-1.1.0-rc.1.css. Q: What's that used
Yesterday when i checked out the latest version of our internal tool i saw
I've run into problems installing the latest Subclipse plug in. I saw this post:
I downloaded the latest version of jsRender and I saw that the layout templates
Saw this option when I made a linked server
I saw that the latest R version supports byte compilation. What is the performance
I saw on jQuery UI site such line in source code: <script src=http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js type=text/javascript></script>
I saw a blog post the other day that had a screen shot of
I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
I saw a java function that looked something like this- public static<T> foo() {...}

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.