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.
Hello There. I found your blog using msn. This is a very well written article.
I’ll make sure to bookmark it and return to read more of your useful info.
Thanks for the post. I will definitely return.
Howdy! Do you know if they make any plugins to protect against hackers?
I’m kinda paranoid about losing everything I’ve worked hard on.
Any suggestions?
The other day, while I was at work, my cousin stole my apple ipad and tested
to see if it can survive a thirty 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!
Oh my goodness! Awesome article dude! Thanks,
However I am having issues with your RSS. I don’t know why I cannot subscribe to it.
Is there anybody getting similar RSS problems? Anyone that knows the answer can you kindly respond?
Thanx!!
I think what you said made a lot of sense. But, what about this?
suppose you were to create a awesome post title?
I ain’t suggesting your content isn’t solid., but what
if you added a title that makes people want more?
I mean jQuery CDN as A Named Module In RequireJS | freestyle developments is a little vanilla.
You might look at Yahoo’s home page and see how they create
news headlines to grab viewers interested. You might add a video or a related picture or two
to grab readers interested about what you’ve got to say.
Just my opinion, it would bring your posts a little livelier.
Hello there, I discovered your blog by the use of
Google even as searching for a similar matter, your
website came up, it seems to be great. I have bookmarked it in my google bookmarks.
Hello there, simply became alert to your weblog thru Google,
and located that it is truly informative. I’m going
to watch out for brussels. I will be grateful should you proceed this in future.
Many other folks will be benefited from your writing. Cheers!
Hi my friend! I want to say that this article is amazing,
great written and come with almost all vital infos.
I would like to look extra posts like this .
Hello, i feel that i saw you visited my weblog
thus i got here to go back the prefer?.I am attempting to find things to enhance my
site!I suppose its good enough to use some of your ideas!!
Hello, I would like to subscribe for this webpage to take newest updates,
thus where can i do it please assist.
Pretty! This was an incredibly wonderful article.
Thank you for supplying these details.
It’s actually a cool and useful piece of info. I am glad that you simply shared this
helpful info with us. Please stay us up to date like this.
Thanks for sharing.
What’s up to every one, the contents existing at this site are in fact
awesome for people knowledge, well, keep up the nice work fellows.
Hello everyone, it’s my first visit at this site, and post
is actually fruitful in support of me, keep up posting these
types of content.
My webpage – High stakes casino download