Thursday, May 31, 2012

Downloading jQuery CSS from Google"s CDN


I am planning on using Google to download the jQuery lib for both UI and Core. My question is, do they allow me to download the CSS for it or should I have to host it myself?



Also if I use Google to load how should I load other plugins? Can I compress all plugins together or should it be its own separate file?


Source: Tips4all

4 comments:

  1. The Google AJAX Libraries API, which includes jQuery UI, also includes popular themes as per the jQuery UI blog:


    CSS framework and themes on Google AJAX Libraries API

    As before, the latest stable release of jQuery UI (now 1.8) is hosted on Google’s CDN. New in this release, however, Google is also hosting the new jQuery UI CSS Framework, as well as our current suite of pre-built themes: base, black-tie, blitzer, cupertino, dot-luv, excite-bike, hot-sneaks, humanity, mint-choc, redmond, smoothness, south-street, start, swanky-purse, trontastic, ui-darkness, ui-lightness, and vader.

    ReplyDelete
  2. Google is hosting jQueryUI css at this link https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.all.css

    If you look at this code directly, it is importing the css using @import which can be slow. You may want to factor the import into its parts to gain a slight performance benefit:

    https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css
    https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css

    ReplyDelete
  3. I would think so. Why not? Wouldn't be much of a CDN w/o offering the CSS to support the script files

    This link suggests that they are:


    We find it particularly exciting that
    the jQuery UI CSS themes are now
    hosted on Google's Ajax Libraries CDN.

    ReplyDelete
  4. Your page load times will be a factor of googles response time.

    ReplyDelete