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.

9,488 thoughts on “jQuery CDN as A Named Module In RequireJS

  1. Heya i am for the first time here. I came across this board and I
    find It really useful & it helped me out a lot.
    I hope to give something back and help others like you aided me.

  2. I wanted to thank you for this excellent read!! I certainly loved every bit of it.

    I have you saved as a favorite to look at
    new things you post…

  3. Fantastic website you have here but I was curious about if
    you knew of any message boards that cover the same topics discussed here?

    I’d really love to be a part of community where I can get
    opinions from other experienced individuals that share the same interest.
    If you have any suggestions, please let me know.
    Cheers!

  4. My partner and I stumbled over here from a different web address and
    thought I might as well check things out. I like what I see so i am just following you.
    Look forward to looking over your web page yet again.

  5. It’s nearly impossible to find experienced people on this topic, however, you sound like you
    know what you’re talking about! Thanks

  6. Hi would you mind letting me know which hosting company you’re using?
    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 reasonable price?
    Kudos, I appreciate it!

  7. Project-based knowing аt OMT transforms math
    іnto hands-on fun, sparking passion in Singapore pupils
    fοr impressive exam outcomes.

    Join оur smaⅼl-group on-site classes in Singapore fߋr individualized assistance іn а nurturing environment that builds strong foundational mathematics skills.

    Ꮃith mathematics incorporated seamlessly into Singapore’s class settings tⲟ benefit both instructors and students, dedicated math
    tuition amplifies tһeѕe gains by offering customized assistance
    fߋr sustained accomplishment.

    primary school math tuition іs essential for
    PSLE preparation аs it helps students master tһe
    foundational principles ⅼike fractions ɑnd decimals, which ɑre heavily evaluated in tһe exam.

    Tuition cultivates advanced ρroblem-solving skills,
    crucial for addressing the facility, multi-step inquiries tһat define О Level mathematics obstacles.

    Tuition educates mistake analysis strategies, aiding junior university student
    stay ϲlear of usual risks іn A Level computations
    and proofs.

    Ꮃhat collections OMT ɑpaгt іѕ its custom-made math program tһat expands ρast
    tһe MOE curriculum, promoting crucial analyzing hands-ⲟn, practical workouts.

    Gamified aspects mаke modification enjoyable lor, encouraging mоre practice ɑnd гesulting in grade improvements.

    Ӏn Singapore, whеre mathematics effectiveness ⲟpens doors to STEM professions,
    tuition іѕ indispensable for solid examination structures.

    Feel free to visit my web-site – small group math tuition

  8. A person essentially lend a hand to make severely articles I might state.

    This is the very first time I frequented your website page and so far?

    I surprised with the analysis you made to make this particular put up
    incredible. Great activity!

  9. Hey there! Quick question that’s completely off topic. Do you know how to make your site mobile friendly?
    My web site looks weird when browsing from my iphone 4.
    I’m trying to find a theme or plugin that might be able to fix this issue.
    If you have any recommendations, please share. Thank you!

  10. Greetings! I know this is kind of off topic but I
    was wondering which blog platform are you using for this
    site? I’m getting sick and tired of WordPress because I’ve
    had problems with hackers and I’m looking at options for another platform.
    I would be great if you could point me in the direction of a good platform.

  11. Worldwide of forex trading, non-farm payroll (NFP) reports offer as
    a considerable financial indicator that influences
    market motions. Released on the initial Friday of each month by
    the Bureau of Labor Statistics in the United States, the NFP report highlights work adjustments in various industries,
    omitting farms, government, and a few other task classifications.
    Due to the fact that they offer insight right into the wellness of the U.S.
    economy, market participants carefully watch these releases.
    Favorable NFP numbers normally show a growing economy, which can cause a stronger dollar and timely adjustments in trading placements.
    Conversely, frustrating numbers can result in volatility in the forex market, causing traders to reassess their methods.
    Effective traders not just maintain an eye on NFP records however additionally check just
    how such releases communicate with other economic data points to form their overall
    market sight.

  12. Hi friends, its fantastic paragraph regarding teachingand completely explained, keep it up all the time.

  13. Today, 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 totally off topic but I had
    to share it with someone!

  14. My partner and I stumbled over here by a different website and thought I should check things
    out. I like what I see so now i’m following you. Look forward to
    looking at your web page again.

  15. Hello! I understand this is kind of off-topic however I had to
    ask. Does managing a well-established blog like yours require a lot of work?
    I am brand new to blogging but I do write in my journal on a daily basis.
    I’d like to start a blog so I can share my experience and views online.
    Please let me know if you have any recommendations or tips for new aspiring blog
    owners. Thankyou!

  16. Hello there, just became alert to your blog through Google, and found that it’s really informative.
    I’m going to watch out for brussels. I’ll appreciate if you continue
    this in future. Many people will be benefited from your writing.
    Cheers!

  17. It’s remarkable in support of me to have a site, which is helpful designed for
    my knowledge. thanks admin

  18. Greate article. Keep posting such kind of information on your site.

    Im really impressed by it.
    Hello there, You’ve done a great job. I will definitely digg it and in my view
    suggest to my friends. I’m confident they will be benefited
    from this site.

  19. Hey there! This is kind of off topic but I need some advice from an established blog.
    Is it very difficult to set up your own blog? I’m not very techincal but I can figure things out pretty fast.
    I’m thinking about creating my own but I’m not sure where to
    begin. Do you have any ideas or suggestions? Thank you

  20. Excellent post. I was checking continuously this blog and I’m impressed!
    Very useful information specially the last part
    :) I care for such information a lot. I was looking for this certain info for a very
    long time. Thank you and good luck.

  21. You really make it appear really easy along with your presentation however I in finding this matter to
    be really one thing which I believe I might never understand.
    It kind of feels too complicated and very extensive for me.
    I am taking a look forward on your subsequent publish, I’ll try to get the
    hang of it!

  22. I like the valuable info you provide in your articles.
    I will bookmark your blog and check again here regularly.

    I am quite sure I’ll learn a lot of new stuff right here!
    Best of luck for the next!

  23. Currently it appears like BlogEngine is the top blogging
    platform available right now. (from what I’ve read) Is that what you’re
    using on your blog?

  24. Hi just wanted to give you a brief heads up
    and let you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue.
    I’ve tried it in two different web browsers and both show the same outcome.

  25. I am in fact thankful to the owner of this web site who has shared this
    wonderful piece of writing at at this place.

  26. Very nice post. I just stumbled upon your weblog and wished to say that I have truly enjoyed browsing your blog posts.

    In any case I will be subscribing to your feed and I hope you write again very soon!

  27. Hi i am kavin, its my first time to commenting anywhere, when i read this article i thought i could also make comment
    due to this brilliant piece of writing.

  28. Hey there! Quick question that’s completely off topic.

    Do you know how to make your site mobile friendly?

    My website looks weird when viewing from my iphone. I’m trying to find
    a theme or plugin that might be able to resolve this problem.
    If you have any recommendations, please share. Thanks!

  29. I really like what you guys are up too. Such clever work and exposure!
    Keep up the fantastic works guys I’ve included you
    guys to my blogroll.

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>