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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:46:10+00:00 2026-06-11T03:46:10+00:00

I have Backbone App Here are codes : This is Main.coffee : require [App/app,backbone]

  • 0

I have Backbone App Here are codes :

This is Main.coffee :

require ["App/app","backbone"] ,(App,Backbone)->
app = new App()
Backbone.history.start()

This is app.coffee :

class AppRouter extends Backbone.Router 
    routes :
        "" : 'Base'
        "Browse/:id" : "Details"

    initialize : ->         
        @render()

    Browse : (id) ->
        console.log "Hello"
        stud = new Student({UserKey:id})
        stud.fetch({
            success :->
                $('#content').html new View({model:stud}).el
        })
        null

This is my View.coffee

define ['jquery'
    ,'underscore'
    ,'backbone'
    ,'text!/Templates/Student/View.htm'] , ($ , _ , Backbone , ViewTemplate) ->

class StdView extends Backbone.View

    #_.templateSettings = { interpolate: /\{\{(.+?)\}\}/g };

    #template : _.template(View)

    initialize : (options) ->           
        @render()

    render :->
        console.log @model.toJSON()
        #@setElement @template @model.toJSON()
        @

And This is my View Template ( For showing details of student)

  <input type="text" name="firstname" value="{{FirstName}}" placeholder="First Name" />
    <input type="text" name="lastname" value="{{LastName}}" placeholder="Last Name" />

The items are rendered into a table with a link from where i click on edit buttton to get the details . Here is the template portion where the ids get rendered .

 <td>
    <a class="btn btn-small btn-inverse" href="#browse/{{UserKey}}"><i class="icon-edit icon-white"></i></a>
</td>

Now i have started the Backbone.history.start() . But no way its going to the Browse method which it should go if i click on link for example as : /browse/1 . Its not happening . The link which is rendered on the browser when i click is like this

http://localhost:40921/#browse/5

So where is it after all going wrong ???????

  • 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-11T03:46:11+00:00Added an answer on June 11, 2026 at 3:46 am

    Routes are case sensitive, you should have this:

    routes :
        "" : 'Base'
        "browse/:id" : "Details"
    

    if you want #browse/5 to do anything. Or keep your routes as they are now and change your link to use #Browse/5.

    Demo: http://jsfiddle.net/ambiguous/NLzyS/

    If you want a case insensitive route, you could add a regex route manually using route:

    initialize: ->
        @route(/browse\/(\d+)/i, 'Details')
    

    Demo: http://jsfiddle.net/ambiguous/2S6wr/

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

Sidebar

Related Questions

Say I have the following Backbone Router: class App.Routers.ThingsRouter extends Backbone.Router initialize: -> new
I'm using backbone for an app that I'm building. In this app, I have
I have the following Backbone router definition in CoffeeScript: // appointments_router.js.coffee define [app, appointment],
We have a backbone.js app that displays a number of forms to the user.
I have the following code in my Backbone app, Is there a way to
I am building a Backbone app and I need to have automated tests. I
i have a backbone.js api i want to use in an ExtJS app. Extjs
I have a Rails 3.2.3 app with Backbone.js and I'm using pushState on my
I have two backbone Views. One is the main view and the other is
We have a very large app with TONS of backbone code throughout our codebase...

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.