[Building Sakai] Javascript Libraries
Charles Severance
csev at umich.edu
Mon Jan 13 08:59:04 PST 2014
Yeah - Of course your log fills with errors if you have 20 files that include themselves that way.
I already use that trick in the frameless main portal to detect if the tool loaded the right version of JQuery or not and if not, load the right JQuery for the portal.
/Chuck
On Jan 13, 2014, at 11:49 AM, Matthew Jones <matthew at longsight.com> wrote:
> I remember seeing a good tip for using a CDN and then having a fallback to the local version (if the CDN isn't accessible of if you're offline)
>
> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
> <script>!window.jQuery && document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script>
>
> Similar to here [1], but that require.js example looks even cooler and is more flexible with fallback libs.
>
> [1] http://www.hanselman.com/blog/CDNsFailButYourScriptsDontHaveToFallbackFromCDNToLocalJQuery.aspx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140113/c8ec1856/attachment.html
More information about the sakai-dev
mailing list