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

  1. First off I want to say terrific blog! I had a quick question that
    I’d like to ask if you do not mind. I was interested to know how you center
    yourself and clear your thoughts prior to writing.

    I have had a hard time clearing my mind in getting my
    ideas out there. I do enjoy writing however it just seems like the first
    10 to 15 minutes are generally wasted simply just trying to figure out how
    to begin. Any recommendations or hints? Cheers!

  2. That is really attention-grabbing, You are an excessively skilled blogger.
    I have joined your feed and look ahead to in search of extra of your great
    post. Also, I have shared your website in my social networks

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

  4. Artikel ini benar-benar bermanfaat.
    Saya setuju dengan isi yang disampaikan.
    Mantap sudah berbagi informasi yang berkualitas
    seperti ini.
    Saya akan ingat halaman ini dan kunjungi lagi nanti.
    Tetap semangat untuk admin.

  5. After exploring a few of the blog articles on your
    website, I truly like your way of blogging. I saved it
    to my bookmark webpage list and will be checking back in the near future.
    Take a look at my web site as well and tell me how
    you feel.

  6. I’ve been exploring for a little bit for any high-quality articles or weblog posts on this kind of area .
    Exploring in Yahoo I finally stumbled upon this site.

    Studying this info So i’m glad to exhibit that I’ve an incredibly good uncanny feeling I
    came upon exactly what I needed. I so much undoubtedly will make certain to don?t
    put out of your mind this website and provides it a
    glance on a relentless basis.

  7. Alpha Tonic seems to be gaining a lot of attention lately as a natural supplement for boosting
    male energy and vitality. I like that it’s focused on supporting stamina, strength, and overall wellness rather
    than relying on quick fixes. Some people are already sharing positive results
    with improved energy levels and confidence, which
    makes it sound promising. If you’ve been feeling low on drive or performance,
    Alpha Tonic could be worth looking into as a natural support.

  8. I like the helpful information you provide in your articles.
    I’ll bookmark your weblog and check again here frequently.
    I’m quite sure I will learn plenty of new stuff right here!
    Good luck for the next!

  9. Hi there! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche.
    Your blog provided us valuable information to work on. You have done a wonderful job!

  10. I do not even know how I ended up right here, however I assumed
    this put up was good. I do not recognize who you’re but certainly you’re
    going to a famous blogger should you aren’t already. Cheers!

  11. Wat je vraag, probleem of klacht ook is, je kunt terecht bij de klantenservice van ons online casino. We gaan in onze Betcity review kijken naar de welkomstbonus, welke overige promoties er beschikbaar zijn, bonusvoorwaarden en een vip programma aanwezig is, het aanbod aan sport weddenschappen, live wedden mogelijkheden, de kwaliteit van het online en live casino, stortingsmethoden en de aanwezige uitbetaal en winst limieten en niet te vergeten de klantenservice. Voor de volledige Bonus Voorwaarden, zie de Bonusvoorwaarden. Hoe claim je de no deposit bonus? Een bonus die wel elke dag te claimen is, is de cashback bonus. Elke dag ontvang je nieuwe missies waarmee je punten kan verzamelen. Medio 2024 zijn er inmiddels al meer dan 30 vergunningen verstrekt, maar nog niet elke aanbieder is al online met zijn diensten. Met laatstgenoemde optie heb je elke spin 10 geopende Enhancer Cells en maak je sowieso kans op de exorbitante hoofdprijs, maar daar hangt dus wel een aardig kostenplaatje aan. De Rechtbank te Amsterdam is uitsluitend bevoegd om kennis te nemen van mogelijke geschillen, tenzij de wet dwingend een andere rechtbank voorschrijft.

  12. Hi there! I could have sworn I’ve visited this site before but after looking at
    a few of the articles I realized it’s new to me.
    Regardless, I’m certainly delighted I found it and I’ll be bookmarking it and checking back often!

  13. Greetings from Idaho! I’m bored to tears at work so I decided to
    check out your blog on my iphone during lunch break.

    I enjoy the knowledge you provide here and can’t wait to take
    a look when I get home. I’m amazed at how fast your
    blog loaded on my cell phone .. I’m not even using WIFI, just 3G ..
    Anyways, superb site!

  14. Effective fat loss stack often consist of ingredients like caffeine, environment-friendly tea extract, L-carnitine, and forskolin. These substances assist boost metabolic rate, boost energy, and support fat oxidation. As an example, caffeine enhances performance and stamina during exercises, although green tea essence offers antioxidants that assist break fat tissues better, https://www.akaqa.com/account/profile/19191788483.

  15. Кракен (kraken) – ты знаешь что это, уже годами проверенный сервис российского даркнета.

    Недавно мы запустили p2p обмены
    и теперь вы можете обменивать любую сумму для пополнения.

    Всегда есть свежая ссылка кракен через ВПН:
    кракен qr код

  16. Thanks , I have just been looking for information about
    this topic for a long time and yours is the greatest
    I have discovered till now. But, what concerning the bottom line?

    Are you positive concerning the supply?

  17. It’s really a cool and helpful piece of information.
    I am glad that you shared this useful info with us. Please keep us informed like this.
    Thank you for sharing.

  18. Its like you read my mind! You seem to know so much about this, like you wrote the book in it or
    something. I think that you can do with a few pics to drive the message home a
    little bit, but instead of that, this is magnificent blog.

    A great read. I’ll definitely be back.

  19. Hi, I do think this is an excellent website. I stumbledupon it ;) I am going to return once again since i have saved as a favorite it.
    Money and freedom is the greatest way to change, may you
    be rich and continue to help others.

  20. Wow, marvelous blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look
    of your website is great, as well as the content!

  21. I am really enjoying the theme/design of your site.
    Do you ever run into any web browser compatibility issues?
    A number of my blog visitors have complained about
    my blog not operating correctly in Explorer but looks great in Firefox.

    Do you have any tips to help fix this issue?

  22. Wow that was strange. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up.
    Grrrr… well I’m not writing all that over again.
    Anyhow, just wanted to say superb blog!

  23. I used to be recommended this blog through my cousin. I’m not sure whether or not this put
    up is written by way of him as nobody else understand such special
    approximately my trouble. You are wonderful! Thank you!

  24. Good answer back in return of this query with genuine arguments and explaining all concerning that.

  25. If you are going for finest contents like
    I do, only pay a quick visit this site all the time since it
    presents feature contents, thanks

  26. The Brain Song is such an interesting concept!
    It’s designed to use specific sound frequencies to help improve focus, memory,
    and overall brain performance. I like that it takes a natural, non-invasive approach rather than relying
    on pills or stimulants. If it really delivers on boosting mental clarity and reducing stress, I think it could be a great tool for anyone wanting to sharpen their mind.

  27. I seriously love your website.. Great colors & theme.

    Did you create this amazing site yourself?
    Please reply back as I’m planning to create my very own website and would like
    to know where you got this from or exactly what the theme is named.
    Appreciate it!

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>