I want to use Google CDN for jQuery and jQuery UI..
I'm using the answer from here for jQuery. Best way to use Google's hosted jQuery, but fall back to my hosted library on Google fail
but i don't understand this bit:
if (typeof jQuery == 'undefined')
so how can i do it for jQuery UI? also, will this work with custom jQuery UI theme as this produces a custom js file too?
You can make the call using
You can also link to other Ui themes by changes the name of the theme. In This case change the name base to any other theme name
/base/jquery-ui.css
to any other theme.Check out the jQuery UI Blog for a link of all CDN links http://blog.jqueryui.com/
If you're concerned that the Google CDN ever fails or goes down, you can fall back to a local copy when the CDN is offline (this example is baked into templates like HTML5 Boilerplate):