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.

22,239 thoughts on “jQuery CDN as A Named Module In RequireJS

  1. It is perfect time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I wish to suggest you few
    interesting things or tips. Perhaps you could write next articles referring to this article.
    I wish to read even more things about it!

  2. For newest news you have to pay a visit world wide web and
    on world-wide-web I found this website as a
    most excellent website for most recent updates.

  3. My family members all the time say that I am wasting my time here at
    net, except I know I am getting knowledge everyday by reading thes good articles or reviews.

  4. I like the valuable information you provide in your articles.

    I’ll bookmark your weblog and check again here frequently.
    I am quite certain I’ll learn lots of new stuff right here!

    Good luck for the next!

  5. Its like you read my mind! You appear to know a lot 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 fantastic blog. A fantastic read.
    I will definitely be back.

  6. of course like your web site however you have to test the spelling on quite a few of your posts.
    Several of them are rife with spelling issues and I
    find it very troublesome to inform the reality however I’ll surely come again again.

  7. I have to thank you for the efforts you’ve put in penning this website.

    I am hoping to view the same high-grade blog posts by you in the future as well.
    In truth, your creative writing abilities has encouraged me to get my own, personal site now ;)

  8. Thanks in favor of sharing such a nice idea, paragraph
    is nice, thats why i have read it fully

  9. Have you ever thought about including a little bit
    more than just your articles? I mean, what you say is important and all.

    But think about if you added some great graphics or video
    clips to give your posts more, “pop”! Your content is excellent but with images
    and videos, this site could undeniably be one of the very best in its
    niche. Wonderful blog!

  10. Having get right of entry to distinct elements adapted certainly toward improving social/emotional construction proves valuable throughout varied backgrounds encountered every single day!!! ### anyKeyWord### infant child care

  11. hello there and thank you for your information –
    I’ve certainly picked up something new from right
    here. I did however expertise a few technical issues using this site, since I
    experienced to reload the site lots of times previous to I could get it to
    load properly. I had been wondering if your web host is OK?
    Not that I am complaining, but sluggish loading instances times will often affect your placement in google and can damage your quality
    score if ads and marketing with Adwords. Anyway I am adding this RSS to my e-mail and can look out for a lot more of your respective exciting content.
    Ensure that you update this again soon.

  12. More generally, such sequences are used to drive otherwise
    endergonic reactions and are additionally present in other metabolic pathways just like the citric acid cycle, the
    pentose phosphate pathway, and fatty acid synthesis. 0.9 kJ/mol (0.2 kcal/mol).
    31.Four kJ/mol (7.5 kcal/mol). Under intracellular situations, nonetheless, the precise
    ΔG is extremely unfavorable (-25 kJ/mol, or -6 kcal/mol), as a consequence of speedy consumption of PEP, which retains its focus low.
    Thus, the formation of PEP from pyruvate is effectively irreversible in vivo.
    Gluconeogenesis can proceed from varied glucogenic precursors.

    This section examines the precise steps involved when pyruvate or alanine serve
    as the beginning supplies, highlighting how the
    pathway adapts in line with the metabolic circumstances.
    The reactions described below predominate when pyruvate or alanine is the glucogenic precursor.

    Since pyruvate carboxylase is a mitochondrial enzyme, pyruvate should first be
    transported from the cytosol into the mitochondrial matrix.

    This transport is mediated by particular proteins situated in the interior mitochondrial membrane,
    namely MPC1 and MPC2. These two proteins associate to form a hetero-oligomeric complex that facilitates pyruvate import
    into mitochondria.

    my homepage – Healthy Flow Blood formula

  13. Hi there! I know this is kinda off topic however , I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest writing a blog article or
    vice-versa? My blog addresses a lot of the same topics as yours and I feel
    we could greatly benefit from each other. If you’re interested feel free to shoot me an e-mail.
    I look forward to hearing from you! Wonderful blog by
    the way!

  14. It is perfect time to make a few plans for the longer term and it is time to be happy.
    I’ve learn this publish and if I may just I wish
    to suggest you few attention-grabbing things or tips. Perhaps you can write subsequent articles regarding this article.
    I want to read even more issues approximately it!

    my web page: ремонт карданов

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>