Is there anyway to load jQuery-UI theme from CDN, but with local fallback? Similar to the javascript fall-back outline here? Google Hosted CDN with fall back
I would recommend using the resource loader yepnope:
yepnope([{
load: 'http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js',
complete: function () {
if ( !window.jQuery ) {
yepnope('local/jquery.min.js');
}
}
}, {
load: 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js',
complete: function () {
if ( !window.jQuery.ui ) {
yepnope('local/jquery-ui.min.js');
}
}
}]);
This will first try to load jQuery with local fallback, then load jQUery UI with local fallback.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With