This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Viggie
almost 9 years

General Question About JQuery Ui

So if I wanted to use some of these effects on my own project, I would need to download the JQuery Ui file from the linked website, then reference it in my html document in the same way that I would link to a .css file containing all my css stuff. Is this correct?
It seems that codecademy is linking to the file through a website address in these exercises, is that also an option and is one method better than another? Also, is the the same way that bootstrap is utilized? Thanks!

Answer 5551921fe0a300488f000249

0 votes

Permalink

If you have a website, then reduce server load on your domain by referring to the CDN for common libraries such as jQuery and Bootstrap. A lot of the resources are already cached on users’ computers and don’t even have to download. Your pages load quicker as a result.

code.jquery.com

is a suitable source for jQuery, but there are others. Bootstrap uses MaxCDN, I believe. At any length, this is the best way to link to libraries. Be sure to include http: in the URL if running on the local machine.

Of course, you can still download the files and keep a local version for offline use, but if you’re already connected to the internet, you may as well pull them in from the CDN. They’ll cache in your browser.

points
Submitted by Roy
almost 9 years

4 comments

Viggie almost 9 years

So just to make sure I understand correctly… code.jquery.com for example had a minified jquery at http://code.jquery.com/jquery-2.1.4.min.js To use this via the CDN instead of downloading it I can just link to it like this on my html? <script href http:http://code.jquery.com/jquery-2.1.4.min.js>

Viggie almost 9 years

I messed that last part up but you get my point I’m sure. Btw, thanks a ton for answering all these questions! Its really really helpful to be able to get questions answered in a clear and straightforward way. Alot of the Q&A on stackexchange is still a bit over my head.

Roy almost 9 years
... If you want your script to work in IE
Roy almost 9 years

And, you’re welcome, btw. Glad it helped.