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.

2,256 thoughts on “jQuery CDN as A Named Module In RequireJS

  1. I do not even know how I ended up here, but I thought this post was good.
    I don’t know who you are but definitely you’re going
    to a famous blogger if you are not already ;
    ) Cheers!

  2. When I originally commented I appear to have clicked on the -Notify me when new
    comments are added- checkbox and now whenever a comment is
    added I get four emails with the same comment. Is there an easy method you are able to remove me
    from that service? Cheers!

  3. Hi mates, how is everything, and what you wish for to say about this post, in my view
    its truly awesome designed for me.

  4. Ꭺvoid take lightly lah, combine a reputable Junior College plᥙs
    math proficiency to ensure high A Levels scores and
    seamless shifts.
    Parents, fear tһe gap hor, maths groundwork iѕ essential in Junior College
    fⲟr grasping іnformation, vital ᴡithin modern tech-driven market.

    Anderson Serangoon Junior College іs a dynamic organization born fгom the merger of two
    renowned colleges, cultivating ɑ supportive environment tһat highlights holistic advancement аnd
    scholastic excellence. The college boasts contemporary facilities, including advanced labs ɑnd collaborative аreas, enabling trainees to engage deeply іn STEM аnd innovation-driven jobs.
    Wіth a strong focus οn management and character structure,
    trainees benefit frⲟm varied cߋ-curricular activities tһat cultivate resilience аnd team effort.

    Іts dedication t᧐ worldwide viewpoints tһrough exchange programs broadens horizons аnd prepares
    students foг an interconnected wоrld. Graduates ߋften safe places in leading
    universities, reflecting tһe college’ѕ commitment to nurturing positive, ᴡell-rounded
    people.

    Anglo-Chinese Junior College serves ɑs an excellent design of holistic
    education, effortlessly integrating ɑ difficult scholastic curriculum ᴡith
    a compassionate Christian foundation tһɑt nurtures ethical worths,
    ethical decision-mɑking, ɑnd ɑ sense οf function in every
    trainee. Thе college іs equipped with advanced
    infrastructure, consisting ߋf modern lecture theaters,
    ѡell-resourced art studios, ɑnd higһ-performance sports complexes, ԝhere experienced teachers assist students tо achieve remarkable lead to
    disciplines varying fгom tһe humanities to the sciences, typically mаking national and
    worldwide awards. Students are motivated tо participate in a rich range of аfter-school activities, ѕuch as competitive
    sports ɡroups that construct physical endurance аnd team spirit, ɑlong wіth performing arts ensembles tһаt cultivate artistic expression ɑnd cultural gratitude, ɑll contributing to a ѡell balanced lifestyle filled
    witһ passion and discipline. Througһ strategic international collaborations, consisting օf student exchange programs witһ partner schools
    abroad and participation in worldwide conferences, thhe college
    instills а deep understanding of varied cultures ɑnd global issues,
    preparing learners tо navigate an progressively interconnected ᴡorld ԝith grace and insight.
    Ƭhe impressive track record оf its alumni, whօ stand out in management functions tһroughout industries ⅼike service, medicine, аnd the arts, highlights Anglo-Chinese Junior College’ѕ extensive impact іn developing principled, innovative leaders ѡho make favorable impacts օn society ɑt lɑrge.

    Eh eh, calm pom pi pi, mathematics proves ᧐ne of the top topics at Junior College, building foundation fоr
    A-Level calculus.
    Ꭺpɑrt beyond institution amenities, concentrate with maths tօ prevent
    typical mistakes ѕuch aѕ inattentive errors durіng exams.

    Oi oi, Singapore folks, maths proves рerhaps the moѕt essential primary subject, encouraging innovation fоr pгoblem-solving to goundbreaking careers.

    Ⲟh dear, minus robust mathematics ɑt Junior College, no matter prestigious establishment youngsters mɑy falter in secondary calculations, ѕo develop tһat immеdiately leh.

    Нigh A-levelperformance leads tο alumni networks
    ᴡith influence.

    Listen up, composed pom pi pi, math proves рart in the һighest disciplines ɗuring Junior College, building base tо A-Level һigher calculations.

    Ιn addition to establishment resources, concentrate սpon mathematics
    for ѕtߋρ common pitfalls including sloppy errors аt assessments.

    Heге is my webpage: physics and maths tutor chemistry past papers

  5. I don’t even know how I ended up here, but I thought this post was
    great. I don’t know who you are but certainly you’re
    going to a famous blogger if you are not already ;) Cheers!

  6. Your style is unique in comparison to other folks I have read stuff
    from. Thank you for posting when you’ve got the opportunity,
    Guess I will just book mark this web site.

  7. Greetings from Carolina! I’m bored at work so I decided to browse your blog on my iphone during lunch break.
    I love the information you provide here and can’t wait to
    take a look when I get home. I’m surprised at how quick your blog loaded on my phone
    .. I’m not even using WIFI, just 3G .. Anyhow, very good
    blog!

  8. I am really loving the theme/design of your web site.
    Do you ever run into any browser compatibility issues? A small number of my blog visitors
    have complained about my website not working correctly in Explorer but looks great in Chrome.
    Do you have any recommendations to help fix this problem?

  9. I’m truly enjoying the design and layout of your website.
    It’s a very easy on the eyes which makes it much more
    enjoyable for me to come here and visit more often. Did you hire out a developer
    to create your theme? Great work!

  10. Hey! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.

    If you know of any please share. Cheers!

  11. Yesterday, while I was at work, my cousin stole my iPad and tested to see if
    it can survive a twenty five foot drop, just so she can be a
    youtube sensation. My iPad is now broken and she has 83 views.
    I know this is completely off topic but I had
    to share it with someone!

  12. Can I simply just say what a comfort to uncover an individual who really understands what they’re talking about on the net.
    You definitely understand how to bring a problem to light and make it important.
    More people need to read this and understand this side of
    the story. I was surprised that you aren’t more popular because you surely possess the gift.

  13. Have you ever considered about including a little bit more than just your articles?
    I mean, what you say is fundamental and all. Nevertheless think of if you added some great pictures or videos to give your posts more, “pop”!
    Your content is excellent but with pics and videos, this blog could definitely be one of the very best in its niche.
    Terrific blog!

  14. This is very interesting, You’re a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your magnificent post.
    Also, I have shared your site in my social networks!

  15. Wow, amazing blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of
    your website is magnificent, let alone the content!

  16. I think the admin of this web site is in fact working hard in support of his web site, since here every material is
    quality based material.

  17. This design is spectacular! You most certainly know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job.
    I really enjoyed what you had to say, and more than that, how
    you presented it. Too cool!

  18. My spouse and I stumbled over here by a different web page and thought I might check things out.
    I like what I see so now i’m following you. Look forward to
    going over your web page for a second time.

  19. Hola! I’ve been following your blog for a long
    time now and finally got the courage to go ahead and give you a shout out from Huffman Tx!
    Just wanted to tell you keep up the good work!

  20. Fascinating blog! Is your theme custom made or did you download it
    from somewhere? A theme like yours with a few simple tweeks would really make my
    blog stand out. Please let me know where you got your theme.
    Thanks

  21. I’m curious to find out what blog platform you’re using?
    I’m experiencing some small security problems with my
    latest site and I’d like to find something more secure.
    Do you have any recommendations?

  22. Admiring the commitment you put into your site and in depth information you provide.
    It’s nice to come across a blog every once in a while that isn’t the same
    out of date rehashed information. Great read! I’ve saved your site and I’m adding
    your RSS feeds to my Google account.

  23. Hey I am so glad I found your blog, I really found you by error, while I was looking on Digg for something else, Anyways I am here now
    and would just like to say kudos for a incredible post and a all round enjoyable
    blog (I also love the theme/design), I don’t have time to
    read it all at the minute but I have bookmarked it and also added in your
    RSS feeds, so when I have time I will be back to read a great deal more, Please
    do keep up the fantastic job.

  24. I’m no longer sure the place you are getting your info, but great topic.

    I must spend some time finding out much more or working
    out more. Thanks for great information I was on the lookout for this info for my mission.

  25. Hello would you mind sharing which blog platform you’re using?
    I’m planning to start my own blog in the near future but
    I’m having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and I’m looking for something unique.
    P.S Apologies for being off-topic but I had to ask!

  26. No matter if some one searches for his vital thing, thus he/she wishes to be
    available that in detail, therefore that thing is maintained over here.

  27. Hi! I just came across this fantastic article on virtual gambling and couldn’t resist the chance to share it.
    If you’re someone who’s interested to explore more about the industry
    of online casinos, this article is a must-read.

    I have always been interested in casino games, and after reading this, I gained so
    much about how to choose a trustworthy online casino.

    The article does a great job of explaining everything from tips
    for betting. If you’re new to the whole scene, or even if you’ve been playing for years, this guide is an essential read.
    I highly recommend it for anyone who wants to get more familiar with the best
    online casinos available.

    Additionally, the article covers some great advice about selecting
    a trusted online casino, which I think is extremely important.
    So many people overlook this aspect, but this post clearly shows
    you the best ways to stay safe.

    What I liked most was the section on rewards and free spins, which I think is crucial when choosing a site to play on. The insights here are priceless for anyone looking to take
    advantage of bonus offers.

    In addition, the guidelines about limiting your losses were very useful.

    The advice is clear and actionable, making it easy for gamblers to
    take control of their gambling habits and stay within their limits.

    The benefits and risks of online gambling were
    also thoroughly discussed. If you’re considering trying your luck
    at an online casino, this article is a great starting point to understand both the excitement and the risks involved.

    If you’re into poker, you’ll find tons of valuable tips here.

    They really covers all the popular games in detail, giving you the tools you need to boost your skill level.
    Whether you’re into competitive games like poker
    or just enjoy a casual round of slots, this article has plenty for everyone.

    I personally appreciated the discussion about transaction methods.
    It’s crucial to know that you’re gambling on a site that’s safe and protected.
    It’s really helps you make sure your personal information is in good hands when you bet online.

    In case you’re unsure where to start, I highly recommend reading this post.
    It’s clear, informative, and packed with valuable insights.
    Definitely, one of the best articles I’ve come across
    in a while on this topic.
    If you haven’t yet, I strongly suggest
    checking it out and seeing for yourself. You won’t regret it!

    Trust me, you’ll finish reading feeling like a better prepared
    player in the online casino world.
    Whether you’re a beginner, this post is an excellent resource.
    It helps you navigate the world of online casinos and
    teaches you how to maximize your experience. Definitely worth checking out!

    I really liked how well-researched and thorough this
    article is. I’ll definitely be coming back
    to it whenever I need a refresher on online gambling.
    Has anyone else read it yet? What do you think? Let me know your thoughts in the comments!

  28. After looking into a few of the blog posts on your blog,
    I honestly like your technique of writing a blog. I bookmarked it to my bookmark site list and will be checking back soon. Please visit my web site too and let me know what you think.

    Also visit my web-site: xem clip 18+

  29. Hi it’s me, I am also visiting this web page regularly, this website is
    really nice and the people are truly sharing good thoughts.

  30. Parfois, le Téléchargements sur Twitter contiennent
    des publicités qui perturbent l’expérience de l’utilisateur,
    mais en utilisant SnapTwitter, vous n’avez pas à vous en préoccuper.

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>