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

The Archive Base Latest Questions

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

I have a view that requires requires Backbone, Undescore, jquery etc. example define([‘jquery’,’undescore’,’backbone’,’subviewA’, ‘subviewB’],

  • 0

I have a view that requires requires Backbone, Undescore, jquery etc.

example

define(['jquery','undescore','backbone','subviewA', 'subviewB'], function($,_,Backbone, SubviewA, SubviewB){
   var View = Backbone.View.extend({
       //other methods here
       render : function() {
           this.subviewA = new SubviewA();
           this.subviewA.render(); 
           this.subviewB = new SubviewB();
           this.subviewB.render();
           return this; 
       }
   });
});

subview example

define(['jquery','undescore','backbone','text!templates/subviewA'], function($,_,Backbone, template){
   var SubviewA = Backbone.View.extend({
       //other methods here
       render : function() {
           this.$el.html(template);
           return this; 
       }
   });
});

My question is if I need to include jquery, undescore and backbone in the subviews too ir I can omit them?

EDIT

I am asking cause in r.js I need every time to tell it to not to biuld those dependencies inside each module.

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

    Theoretically, if you don’t use the $ or _ symbols in your views, you don’t need to list jquery and underscore as direct dependencies of your module (whether it is a view or a subview doesn’t change that).
    You do need to include backbone though, since you reference it directly with : Backbone.View. If you want to be absolutely sure that the Backbone symbol is defined you should declare it as a dependency.

    Some libs register themselves both as AMD modules and as global variables (typically jquery does that). Backbone doesn’t support AMD directly and registers itself at the global level regardless of how it is used. In theory you could not declare it as a dependency, but then you have the risk that require will try and load the script before backbone is loaded in which case the Backbone symbol will not be defined.

    It doesn’t matter much if you redondantly declare the dependencies except for the additional caracters, thus the additional script size.

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

Sidebar

Related Questions

I have a module defined as follows: define( ['backbone', 'View/Sidebar', 'View/ControlBar'], function() { ...
I have a large modal view that pops up and it requires lots of
I have some code in my application layout view that requires an object to
I have a somewhat complex plot task in matplotlib that requires--I think--an autoscale() function
I'm doing a project in seam that requires restful URLs. I have a view
I have a list view class that just like NSCollectionView requires an additional prototype
I have an application(developed in python) that requires a refreshed view from the datastore
I am beginner in rails. I have view that i try to print inside
I have a view that has a column to make it sortable. When clicking
I have a view that renders a list elements using the following template :

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.