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,076 thoughts on “jQuery CDN as A Named Module In RequireJS

  1. Hey there! Quick question that’s entirely off topic.
    Do you know how to make your site mobile friendly?
    My website looks weird when viewing from my iphone4. I’m trying to find
    a theme or plugin that might be able to correct this problem.
    If you have any recommendations, please share. With thanks!

  2. Please let me know if you’re looking for a article author for
    your weblog. You have some really great articles and I believe I would
    be a good asset. If you ever want to take some of the load off, I’d really like to write some
    articles for your blog in exchange for a link back to mine.
    Please send me an email if interested. Many thanks!

  3. I have read so many articles regarding the blogger lovers
    however this piece of writing is truly a pleasant paragraph, keep it up.

  4. Attractive section of content. I simply stumbled upon your
    website and in accession capital to say that I acquire in fact
    enjoyed account your weblog posts. Anyway I’ll be subscribing in your feeds or even I success you get admission to persistently fast.

  5. Just want to say your article is as astounding. The clarity in your post
    is just nice and i could assume you’re an expert on this subject.
    Well with your permission allow me to grab your feed to keep updated with forthcoming post.
    Thanks a million and please continue the enjoyable work.

  6. Today, I went to the beach front with my children. I found a sea shell
    and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and
    screamed. There was a hermit crab inside and it pinched
    her ear. She never wants to go back! LoL I know this is completely off topic but I had to
    tell someone!

  7. My family every time say that I am killing my time here at web, except I know
    I am getting experience everyday by reading thes nice articles or reviews.

  8. Hi, I do think this is an excellent website. I stumbledupon it ;) I may revisit yet
    again since i have saved as a favorite it. Money and freedom is the best way to change,
    may you be rich and continue to help other people.

  9. Mikigaming selalu menjadi pilihan utama
    bagi para pecinta slot online Pragmatic Play yang menginginkan pengalaman bermain terbaik dan peluang kemenangan yang
    menjanjikan.

  10. If you’re searching for a trustworthy and powerful financial service
    that handles not only cryptocurrency transactions like buying Bitcoin but also supports a wide range of fiat operations, then you should definitely check out this topic where users share their experiences about
    a truly all-in-one crypto-financial platform.

    The recommendation shared by users in the discussion made it clear that this platform
    is more than just a simple exchange – it’s a full-fledged financial
    ecosystem for both individuals and companies.
    Whether you’re running a startup or managing finances for a multinational corporation, the features highlighted in this discussion could be a game-changer – multi-user accounts,
    compliance tools, fiat gateways, and crypto custody all in one.

    I’ve rarely come across such a balanced discussion that addresses both crypto-savvy users
    and traditional finance professionals, especially in the context of business-scale needs.

    Highly suggest taking a look if you’re involved in finance,
    tech, or enterprise operations. The recommendation alone is worth checking out.

  11. I have been exploring for a little bit for any high-quality articles or
    weblog posts in this sort of space . Exploring in Yahoo I eventually stumbled upon this
    website. Reading this information So i’m satisfied to express
    that I have an incredibly excellent uncanny feeling I came upon just what I needed.
    I most undoubtedly will make sure to don?t overlook this web site and provides it a
    glance on a continuing basis.

  12. In today’s fast-evolving financial landscape, it’s rare to find a platform that seamlessly bridges both crypto and fiat operations,
    especially for large-scale operations. However, I came across this forum topic that dives
    deep into a platform which supports everything from buying Bitcoin to managing fiat payments, and it’s especially recommended for corporate accounts.

    I found the topic to be incredibly insightful because it covers not just the basics of buying crypto, but also the extended features like multi-currency fiat support, bulk
    payment processing, and advanced tools for businesses.

    What’s particularly valuable is the level of detail provided in the forum topic,
    including the pros and cons, user reviews, and case studies showing how enterprises
    have integrated the platform into their operations.

    This topic could be particularly useful for anyone seeking a compliant, scalable,
    and secure solution for managing both crypto and fiat funds.
    The website being discussed is built to handle everything from simple BTC purchases
    to large-scale B2B transactions.
    Highly suggest taking a look if you’re involved in finance, tech, or enterprise operations.
    The recommendation alone is worth checking out.

  13. Hi would you mind letting me know which web
    host you’re utilizing? I’ve loaded your blog in 3 different web browsers and I must say this blog loads a
    lot faster then most. Can you suggest a good internet hosting provider at a honest price?
    Many thanks, I appreciate it!

  14. I love what you guys are up too. This type of clever work and
    coverage! Keep up the terrific works guys I’ve included
    you guys to my personal blogroll.

  15. all the time i used to read smaller posts that as well clear their motive, and that is also happening with this
    piece of writing which I am reading here.

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>