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

  • Home
  • SEARCH
  • 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 7529235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:36:20+00:00 2026-05-30T04:36:20+00:00

If I enable pushState in the backbone router, do I need to use return

  • 0

If I enable pushState in the backbone router, do I need to use return false on all links or does backbone handle this automatically? Is there any samples out there, both the html part and the script part.

  • 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-30T04:36:22+00:00Added an answer on May 30, 2026 at 4:36 am

    This is the pattern Tim Branyen uses in his boilerplate:

    initializeRouter: function () {
      Backbone.history.start({ pushState: true });
      $(document).on('click', 'a:not([data-bypass])', function (evt) {
    
        var href = $(this).attr('href');
        var protocol = this.protocol + '//';
    
        if (href.slice(protocol.length) !== protocol) {
          evt.preventDefault();
          app.router.navigate(href, true);
        }
      });
    }
    

    Using that, rather than individually doing preventDefault on links, you let the router handle them by default and make exceptions by having a data-bypass attribute. In my experience it works well as a pattern. I don’t know of any great examples around, but trying it out yourself should not be too hard. Backbone’s beauty lies in its simplicity 😉

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

Sidebar

Related Questions

To enable Linkify behavior, I do this in code: textView.setMovementMethod(LinkMovementMethod.getInstance()); Is there a way
To enable a directory listing, we'd use this in Apache: Options Indexes How to
I need to enable/disable completely network interfaces from a script in Windows XP. I'm
In our application we enable users to print pages. We do this by supplying
To enable Servlet, JSP, JSF etc to use a remote EJB , performing resource
I am trying to enable SQL Debugging following this link http://msdn.microsoft.com/en-us/library/ms165038%28VS.80%29.aspx but i can't
I want to enable 'Apply' dialog button when content of some textboxes in this
I need to enable a button when a JS file is finished loading. The
Is it possible to enable/disable 'Application does not run in background'? I know I
I need to enable editing properties of arbitrary objects (the type of object is

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.