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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:40:35+00:00 2026-06-06T18:40:35+00:00

Backbone.js provides a navigate(fragment, [options]) method for its Backbone.router objects, which does the following

  • 0

Backbone.js provides a navigate(fragment, [options]) method for its Backbone.router objects, which does the following (per the documentation):

Whenever you reach a point in your application that you’d like to save as a URL, call navigate in order to update the URL. If you wish to also call the route function, set the trigger option to true. To update the URL without creating an entry in the browser’s history, set the replace option to true.

Thus, simply calling appRouter.navigate('page'); would presumably change the URL to www.myapp.com/page without triggering the corresponding route. However, I’m finding that my router redirects to the URL and also triggers the page route, despite the fact that trigger=false by default.

Thus, the following code:

$(function(){
var AppRouter = Backbone.Router.extend({

    routes: {
        '': 'home',
        'page': 'page',
    },

    home: function() {
        window.app.navigate('page', {replace: true});        
        console.log('home route');    
    },

    page: function () {
        console.log('page route');
    },

});

window.app = new AppRouter();
Backbone.history.start({pushState: true});
});

produces the following console output when navigating to http://www.myapp.com:

> home route
> page route

when the expected console output should just be:

> home route

The method seems to be disobeying the default trigger option. Is this a bug in the implementation, or am I misunderstanding something?

  • 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-06-06T18:40:36+00:00Added an answer on June 6, 2026 at 6:40 pm

    Updating to the latest version of Backbone as of 6/28/12 (the master version on https://github.com/documentcloud/backbone) resolves the issue.

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

Sidebar

Related Questions

I'm using backbone with the backbone-rails gem which does its own templating and project
I am working on a backbone.js application with rails api which provides the json
I am working on a backbone.js application with rails api which provides the json
Backbone.js sents an POST on updated objects instead of an PUT. I think this
A Backbone app which I'm developing has a collection and a model, and associated
I'm following a backbone.js tutorial and came across 2 functions initialize() and render() .
I have a backbone view - which when called presents a form $('#add-offer').click(function() {
As suggested by Backbone documentation, I provide initial data for my collection when the
I'm developing backbone app, which makes crossdomain restful request. The nested data structure in
I have the following backbone.js controller: App.Controllers.PlanMembers = Backbone.Controller.extend({ routes: { message/:messageType: sendMessage, :

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.