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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:24:50+00:00 2026-06-04T21:24:50+00:00

I see many tutorials initializing Backbone Models/Views after jQuery loaded. Why is that? Can’t

  • 0

I see many tutorials initializing Backbone Models/Views after jQuery loaded. Why is that? Can’t you define it before?

For example link

jQuery ->

  class ListView extends Backbone.View

    el: $ 'body'

    initialize: ->
      _.bindAll @
      @counter = 0
      @render()

You could define the classes before document loads and initialize views/models after document loads?


Also I see Models/Views defined under window why is that?

window.TodoView = Backbone.View.extend
  ...
  • 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-04T21:24:51+00:00Added an answer on June 4, 2026 at 9:24 pm

    Why initialize a View after jQuery?

    From the main Backbone page;

    Backbone’s only hard dependency is Underscore.js ( > 1.3.1). For RESTful persistence, history support via Backbone.Router and DOM manipulation with Backbone.View, include json2.js, and either jQuery (> 1.4.2) or Zepto.

    [Emphasis mine]

    So that’s the dependency right there.

    Models/Views defined under window?

    It simplifies these little tutorial examples – everything has access to window, so it makes a useful (if messy) dumping ground for globals (ctors, variables, functions, etc).

    IMO, for larger (non-demo) projects, you should be using something like RequireJS.

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

Sidebar

Related Questions

I see many sites (like ones using vbulletin) that have a... Thank you! You
I see many methods that specify an interface as return value. Is my thought
I see so many apps for blogs like Engadget that all have different pictures
I see that many VIM scripts and shortcuts overwrite markers, such as this helpful
I see there are many tutorials about nhibernate but I cannot find a descent
I am a beginner to the ASP.Net MVC. After reading many tutorials and digesting
There are many tutorials out there and questions on SO that implement custom title
In many iOS books and tutorials they demonstrate how in interface builder you can
I've looked over so many tutorials on the net, and I see quite a
I see many Java samples which use BufferedReader as a static member instead of

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.