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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:59:21+00:00 2026-06-09T22:59:21+00:00

My app’s index page is at http://cms/admin (I’m on localhost). On the index page

  • 0

My app’s index page is at http://cms/admin (I’m on localhost). On the index page there is only one a element:

<a href="/admin/test">deneme</a>

When i click on the link it goes to /cms/admin/test

I want to use BackboneJS’s routing mechanism to convert my app to ajax friendly app but i can’t do it until now. Here is my JS code:

$(function() {
    var AppRouter = Backbone.Router.extend({
        routes: {
            "test": "defaultRoute"
        },

        defaultRoute: function() {
            console.log('its here');
        }
    });

    var appRouter = new AppRouter();

    Backbone.history.start({
        pushState: true,
        slient: true,
        root: '/admin/'
    });
});

When i run the page and click the link, it doesn’t log anything to console and browser follows the link. After page loads, it logs “its here” message.

I already tried it without the root param, “/admin/test” instead of “test”. i tried every combination of: “test”, “/test”, “test/”, “/admin/test”, “admin/test” etc..

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-06-09T22:59:22+00:00Added an answer on June 9, 2026 at 10:59 pm

    You have to override the default behavior of the link.

    You have to move between pages explicitly calling appRouter.navigate("test", {trigger: true});. So try to capture the click event over your link within a View.events, prevent the default behavior of the link and call appRouter.navigate()

    Update

    Also you can do it this in a batch:

    $("a.bb_link").each( function( index, link ){
      $(link).click( function( event ){
        event.preventDefault();
        appRouter.navigate( $(this).attr( "href" ), {trigger: true} );
      });
    });​
    

    Every link with class bb_link will be using the Backbone.Router.

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

Sidebar

Related Questions

/app/config/parameters.ini [parameters] database_driver = pdo_mysql database_host = localhost database_port = database_name = my_dbname database_user
App Engine only allows you to use these formats for XMPP addresses: app-id@appspot.com anything@app-id.appspotchat.com
My app uses the android.support.v4.view.ViewPager class. For each page in the ViewPager, I want
my app has a submit feedback form. Is there a way to can capture
App Engine recently announced support for Cross Group (XG) transactions ; one would expect
app.yaml application: cloudymovie version: 1 runtime: java welcome_files: - test.jsp handlers: - url: /test/*
My app must report its job load via HTTP API. The play status command
This app attempts to display its 3 views on the main display page, as
app dir css style.css inc header.inc.php footer.inc.php index.php login.php register.php style.css is included in
app link: http://itunes.apple.com/en/app/quick-tweet/id505987287?mt=12 How can i make something like that circle? is that a

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.