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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:30:07+00:00 2026-06-15T07:30:07+00:00

I am just getting started with Backbone, and I have set up in a

  • 0

I am just getting started with Backbone, and I have set up in a sample app the backbone dependencies (backbone, underscore, json2), and I started writing some backbone models, views, and such for my app.

My question is: suppose a user navigates to a page in my app. How does this page then initialize/call a backbone view? I was under the impression that I am supposed to include this kind of jQuery/js on the page that is loaded:

 $(document).ready(function(){
   window.app = new SampleApp.Views.Articles.ShowView();
   new SampleApp.Routers.RootRouter();
   Backbone.history.start();
 }); 

And then I thought the Articles ShowView would run:

 $(document).ready(function(){
   SampleApp.Views.Articles || (SampleApp.Views.Articles = {});
   window.SampleApp.Views.Articles.ShowView = Backbone.View.extend({
     el: ".container",
     events: {
       'click .overlay': 'test'
     },
     initialize: function(){
       //eg: this.model.bind('change', this.render, this)
     },

     render: function(){
       $(".container").html('');
       alert('got here');
     },
     test: function(){
       alert('clicked a picture');
     }
   })
 });

However, when I load the page, I don’t get any of the functionality specified in my ShowView. (no alerts etc..). I realize that ‘ShowView’ is a misnomer, as it doesn’t actually do anything yet. But if it is truly being called, then shouldn’t these alerts run?

FYI I think I included all the files for backbone correctly:

 <script src="{{ STATIC_URL }}js/underscore.js"></script>
 <script src="{{ STATIC_URL }}js/json2.js"></script>
 <script src="{{ STATIC_URL }}js/backbone.js"></script>
 {# Models #}
 <script src="{{STATIC_URL}}js/backbone/models/article.js"></script>
 {# Views #}
 <script src="{{STATIC_URL}}js/backbone/views/articles/show.js"></script>
 {# Routers #}
 <script src="{{STATIC_URL}}js/backbone/routers/root.js"></script> 
  • 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-15T07:30:08+00:00Added an answer on June 15, 2026 at 7:30 am

    In your example, you need something that invokes render on the ShowView instance. This can either be the responsibility of a route in your router, or you can just do it in the document ready handler that creates your view.

    window.app = new SampleApp.Views.Articles.ShowView();
    window.app.render();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just getting started couchdb and have been looking into writing couch apps.
I'm just getting started with Visual Studio (2010 Beta) and have some basic questions
Just getting started with Obj-C and iOS programming. I have some code that loads
Just getting started with Backbone. I have a generic view that can render a
Just getting started building an app using the v6 of the facebook c# sdk
I'm just getting started with LINQ, and I'm having some troubles. Say I wanted
I am just getting started with Backbone.js , but it looks really interesting... Right
Just getting started with jQuery, and I've had some success so far. I've created
I'm just getting started with Backbone and ran through a tutorial. I followed along
I'm just getting started with RequireJS and it appears I'm not expressing my dependencies

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.