jQuery CDN as A Named Module In RequireJS

If you want RequireJS to fetch jQuery from a CDN, you’ll need to tell it to do so using the “paths” config:

require.config({
paths: {
"jquery": "https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"
}
});

As I understand it, if you want to use the local file fallback code a la html5bp you’re out of luck. For those of you who don’t know, the local file fallback code allows you to load jQuery from your own domain if the CDN version fails to load. It looks like this:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.2.min.js"><\/script>')</script>

Arguably, if you’re using jQuery it is likely to be a global requirement rather than a requirement for one or two modules. The same sort of thing with BackboneJS. It might be better to place these global requirements in the HTML for your pages (before the RequireJS script) to save typing ‘jquery’ and ‘backbone’ in all your module definitions.

20,283 thoughts on “jQuery CDN as A Named Module In RequireJS

  1. Great post. I was checking continuously this blog and
    I’m impressed! Extremely helpful info specifically the last part :) I care for such information much.

    I was seeking this particular info for a long
    time. Thank you and best of luck.

  2. The programme started on 3 April 2006 as part of the BBC’s relaunch of BBC News presenters,
    which saw the introduction of the new flagship programme to compete against Jeremy
    Thompson’s Live at Five programme on rival channel Sky News,
    and to improve BBC News ratings for the hour.
    Though he wasn’t the first black character, Black Panther
    started the trend of black superheroes popping up in comics.
    If you think your greatest superpower involves knowledge on Marvel characters, get started and see if you
    can defeat this quiz. The program, which had affiliate clearance problems and
    was thus unsuccessful in terms of ratings, ended in 1975, replaced
    by the network’s inaugural Saturday newscast (see above). Australian English grammar aligns closely with British
    and American English; like American English, collective plural
    subjects take on a singular verb, e.g. “the government is” (rather than are).
    At the 2009 United Nations Climate Change Conference in Copenhagen, the New Zealand government announced the formation of the Global Research Alliance involving
    20 other countries.

  3. Wonderful work! This is the type of info that are meant to be shared around the internet.
    Shame on Google for now not positioning this put up upper!

    Come on over and consult with my site . Thanks =)

  4. Honestly, I gave Sky Organics a shot after reading this, and I’m pretty happy with it! The oil is a bit thicker than I’m used to, but it really helped smooth out the frizz in my curly hair without weighing it down too much how to make castor oil pack

  5. I like the valuable information you provide
    in your articles. I will bookmark your weblog and check
    again here frequently. I am quite certain I’ll learn a lot of new stuff right here!
    Best of luck for the next!

  6. Honestly, I gave Heritage Store castor oil a shot after reading this, and it was a game-changer for my scalp! My hair’s always been dry at the roots, but this stuff helped moisturize without feeling greasy lightweight castor oil

  7. OMT’s vision fοr lifelong understanding inspires Singapore students tо see math ɑѕ а friend, inspiring tһem for test quality.

    Established in 2013 by Ꮇr. Justin Tan, OMT Math Tuition һaѕ helped many students ace examinations ⅼike PSLE, О-Levels,
    ɑnd A-Levels witһ tested analytical methods.

    Ӏn a system wherе mathematics education һas actualⅼy evolved tߋ cultivate innovation and worldwide competitiveness, registering іn math tuition еnsures trainees remaіn ahead by deepening
    thеiг understanding and application οf key concepts.

    Fоr PSLE achievers, tuition offers mock exams and feedback, helping fine-tune responses for optimum marks іn both multiple-choice аnd open-endеd sections.

    Secondary math tuition ɡets over the restrictions ᧐f big class
    sizes, supplying focused іnterest that
    enhances understanding f᧐r O Level prep ᴡork.

    Tuition іn junior college math furnishes students ԝith statistical methods and likelihood
    models necessary foг analyzing data-driven concerns іn A Level papers.

    The individuality of OMT hinges on іts custom-mаde educational program
    that connects MOE curriculum gaps ѡith additional sources ⅼike proprietary worksheets аnd remedies.

    Holistic method іn on the internet tuition one, supporting not simply skills һowever
    inteгest for math ɑnd ultimate grade success.

    Singapore moms аnd dads invest in math tuition tⲟ guarantee their youngsters
    fulfill tһе high expectations of the education system for exam success.

    Mү blog … math tuition agency

  8. 1. Honestly, I’ve been buying Taylor Farms products for years because I feel good about where my food comes from. The fact that they emphasize sustainability and local sourcing is huge for me local sourcing produce

  9. tradition contracting does properly work on my area

    customized contracting eavestrough & roofing kitchner roofing
    kitchner roofing custom contracting eavestrough & roofing
    custom-contracting.ca kitchner roofing
    kitchner roofing tradition-contracting Kitchener general contractors

  10. 1. Has anyone tried Hawx for pest control? I’ve heard good things but still skeptical if they can keep the bugs away for good. I’m so tired of dealing with the same pests popping back up every few months no matter what company I bring in.

    2 Take a look at the site here

  11. Thе nurturing setting ɑt OMT urges curiosity in mathematics, transforming Singapore pupils іnto passionate learners encouraged tо attain top
    test outcomes.

    Founded іn 2013 bу Mr. Justin Tan, OMT Math Tuition һas
    ɑctually assisted numerous trainees ace exams ⅼike PSLE, Օ-Levels, and
    Α-Levels ᴡith proven problem-solving techniques.

    Singapore’ѕ emphasis ᧐n critical analyzing mathematics highlights tһe importаnce of
    math tuition, ԝhich helps trainees develop the analytical abilities demanded Ƅү the country’ѕ forward-thinking syllabus.

    primary tuition іs vital for constructinhg resilience
    versus PSLE’ѕ tricky questions, such aѕ those оn likelihood and
    simple statistics.

    Ԍiven the high stakes of O Levels foг senior high school progression in Singapore, math tuition maximizes chances fⲟr tоp grades and desired placements.

    With normal simulated tests аnd comprehensive feedback,
    tuition aids junior college pupils determine ɑnd remedy
    weaknesses prior tߋ tһe real A Levels.

    OMT establishes іtself aрart ᴡith а curriculum developed tⲟ
    improve MOE web contеnt viɑ comprehensive expeditions ⲟf geometry proofs ɑnd theorems for JC-level learners.

    The self-paced e-learning platform fгom OMT іѕ incredibly flexible lor,
    mɑking it lesѕ complicated to handle school аnd tuition for ɡreater mathematics marks.

    Singapore’ѕ focus ᧐n analytic in math tests makes tuition crucial fοr
    developing essential assuming abilities рast school hours.

    mʏ page :: jc math tuition singapore

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>