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

  1. Hi there just wanted to give you a quick heads
    up. The text in your article seem to be running off the screen in Opera.

    I’m not sure if this is a format issue or something to do with internet browser compatibility but I thought I’d post
    to let you know. The design look great though! Hope you
    get the issue solved soon. Thanks

  2. ”For every innovation introduced aiming reduce environmental impact ultimately enhancing overall quality-of-life—we ought recognize contributions made by individuals pioneering change happening right now showcased extensively throughout platforms Cork roofing contractor

  3. Pretty section of content. I just stumbled upon your site and in accession capital to assert that I get actually enjoyed account your
    blog posts. Any way I will be subscribing to your feeds and
    even I achievement you access consistently fast.

  4. Hello my friend! I want to say that this post
    is awesome, nice written and include almost all important infos.
    I’d like to peer more posts like this .

  5. I was suggested this website by my cousin. I am not sure whether this post is written by him as nobody else know
    such detailed about my problem. You’re amazing!
    Thanks!

  6. Love seeing before-and-after roof projects. Quality flashing and proper drip edge make all the difference. Thinking of booking with kitchener for our eavestrough replacement.

  7. certainly like your web site however you have to test the spelling on several of your posts.
    Many of them are rife with spelling problems and I find
    it very bothersome to tell the truth nevertheless
    I’ll surely come back again.

  8. excellent issues altogether, you just gained a brand new reader.
    What would you suggest about your post that you simply made some days in the past?
    Any sure?

  9. My brother recommended I may like this web site. He
    was entirely right. This post actually made my day.
    You can not imagine just how much time I had spent for this
    information! Thank you!

  10. I blog frequently and I really thank you for your content.
    This article has really peaked my interest. I’m going to book
    mark your blog and keep checking for new information about once per week.

    I opted in for your Feed too.

  11. Explore our website to see everything we can do for you:
    detailed service descriptions, flexible options,
    and the latest updates in one place. With a clean, intuitive layout, you can quickly understand how we work, what you
    gain, and which solution fits your goals best.
    Visit now and discover how we can help you achieve more.

  12. Hello there! This is my 1st comment here so I just wanted to give a quick shout out and say I genuinely
    enjoy reading your articles. Can you suggest any other blogs/websites/forums that
    cover the same topics? Thank you!

  13. One nice benefit to enjoying slots online is the Practice Play mode that’s included in all games.
    After you slim down a game, you’ll be prompted to launch it
    in Real Play or Practice Play mode. Go for the latter to play free online slots.
    For those who determine you want the game and need to play for actual cash,
    swap over to Real Play mode. Before you dive into the slots motion, be sure that you’ve got your
    bases lined.Take a moment to implement bankroll management into your session. Consider it like a budget for on-line slots play.
    Start off by deciding how a lot cash you need to dedicate to your session, after which divide
    that amount into items per spin. The dimensions of your items will depend on how long you wish to play for.
    Long classes require smaller items; $5 and below ought
    to work. However, if you favor your sessions brief and candy, you may go with bigger items.
    Determine what number of spins you’ll get by dividing the
    money you intend to spend by the unit. For example, a $300 session divided by $2.50
    models, would give you a hundred and twenty spins.
    At the tip of your a hundred and twenty spins, it’s time to exit the game.
    Check your steadiness to see if the payouts you
    triggered made you money. If not, don’t get tempted to chase losses.

    Enjoy the session for what it was: entertainment. You can at all times play once more the following time you
    wish to go on a slot journey.

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>