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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:12:29+00:00 2026-06-13T22:12:29+00:00

I am building a single page web application and one the requirements are jQuery,

  • 0

I am building a single page web application and one the requirements are jQuery, jQuery-ui and any jquery plugins I decide to use during development.

I am also looking into RequireJS and Backbone to form the MVC structure of the application.
While I have no doubt that RequireJS will be very useful in loading the Backbone MVC modules I create, I am some what indifferent to using it to load jQuery and its plugins.

This is because I consider jQuery to acceptable to use in the global namespace as it will be used everywhere in the entire application.

So my question is: is it okay to make such a separation between modular components and what I would consider as a necessary global component jQuery?

  • 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-13T22:12:30+00:00Added an answer on June 13, 2026 at 10:12 pm

    You want something like this:

    require.config({
      baseUrl: "/js/",
      paths: {
        jquery: 'libs/jquery/jquery-1.7.1',
        'jquery.mobile-config': 'libs/jqm/jquery.mobile-config',
        'jquery.mobile': 'libs/jqm/jquery.mobile-1.1.0',
        'jquery.mobile.asyncfilter': 'libs/jqm/asyncfilter',
        underscore: 'libs/underscore/underscore-1.3.3',
        backbone: 'libs/backbone/backbone-0.9.2',
        templates: '../templates'
      },
      shim: {
              'underscore': {
                exports: "_"
              },
              'backbone': {
                  //These script dependencies should be loaded before loading
                  //backbone.js
                  deps: ['jquery','underscore'],
                  //Once loaded, use the global 'Backbone' as the
                  //module value.
                  exports: 'Backbone'
              },
              'jquery.mobile-config': ['jquery'],
              'jquery.mobile': ['jquery','jquery.mobile-config'],
              'jquery.mobile.asyncfilter': ['jquery.mobile'],
            }
    });
    
    require([
      'jquery',
      'app',
      'jquery.mobile','jquery.mobile.asyncfilter'
    ], function( $, App ){
        $(function(){
          App.initialize();
        });
    });
    

    In your case, you’d replace the jquery-mobile stuff with jquery-ui stuff. Same idea. Jquery is smart enough to put itself in the global namespace, the rest, depending on your version, are not (generally speaking). Hopefully this helps you out. Just remember, if you use a library that isn’t amd compatible, you’ll want to throw it in a shim, like what you see above. The shim is a shortcut to wrapping the library manually (aka, yourself).

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

Sidebar

Related Questions

I'm building a single page, offline html5 web application using jquery mobile, backbone, underscore
I'm building a single-page application. At the moment, I also have several independent pages
I am building a single-page web application and I've been looking for a library
We are building a single page application using jQuery Mobile framework. the scenario we
I am building a single HTML page for use in a touch-screen kiosk. I
I am building a web app with jQuery Mobile. Almost every page of the
I'm building a single page application with asp.net net mvc4 and javascript. My javascript
I am building a calendar web page using jQuery and asp.net-mvc similar to this
I'm building a single page application (e.g. like gmail) and I was wondering which
I'm building a single page web app when Backbone.js is my MV* framework. It

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.