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 6701375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:55:38+00:00 2026-05-26T06:55:38+00:00

1) Which JavaScript hashchange/history library/method should I use for my JavaScript application? 2) And

  • 0

1) Which JavaScript hashchange/history library/method should I use for my JavaScript application?
2) And how do I achieve these 3 things using that method?

A) When the page loads I want to parse the url hash/parameters and set the initial application state.
Specifically, my application consists of a Backbone Collection with two models which has attributes such as selectedCountry, selectedYear etc.
(I don’t think I can use the Backbone.Router as this is a very customized visualization app with complex states?)

B) I want to set up a hashchange listener or similar that lets me update the app state correspondigly

C) On Backbone Collection change events I’d like to update the url. Important: I want to remove the hashchange listener temporarily while doing this so that there is no feedback loop.

Note:
The app is already relying on some HTML5 technologies so the solution does not have to be compatible with the older browsers … But the “feedback loop” part is important as I’ve struggled with this before …

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-26T06:55:38+00:00Added an answer on May 26, 2026 at 6:55 am

    since your already using Backbone, I would stick with Backbone’s Router objects. It will be easier to use what’s already available in your app instead of trying to bring something new in the mix.

    As for your feedback loop problem, I’ve solved this by never firing my router methods from code.

    The gist of it is that I let my JavaScript objects control the state of the application, and do the work for me. When I do call router.navigate, I never pass true as the second argument. I only call router.navigate in response to a state change in my app, to update the hash fragment in my browser window. Here’s the thing: This is purely a response to the state of the application having changed. I never use router.navigate to change the state of my app.

    Hope that helps

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

Sidebar

Related Questions

Which Javascript AOP library do you use, and what are its key features ?
Duplicate: Best javascript compressor Which javascript minification library produces better results? What is the
I have a javascript which I didn't write but I need to use it
I have a large javascript which I didn't write but I need to use
How can we know which javascript method is called and where it is defined?
I have some javascript which runs a timer that animates something on the website.
I have some javascript which will create some sort of widget on a page.
Which JavaScript library (free or commercial) can build computer network diagrams or electrical diagrams.
I have a sample application which has something like below. <a href=javascript:{} id=anchorlnk>Go</a> which
which javascript library is the most recommended and why ?

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.