问题
I'm using the for falling back and serving jquery locally if Googles CDN fails, following this thread.
Does anyone have advice for how to fall back on local jquerytools if the CDN version fails? There's a similar technique for Flowplayer discussed in Flowplayer forum, but I haven't figured out how to do it for jquerytools.
Thanks for any tips.
回答1:
You can use flashembed object from jQuery Tools, like this:
<script src="http://cdn.jquerytools.org/1.2.7/all/jquery.tools.min.js"></script>
<script>window.flashembed || document.write('<script src="js/jquery.tools.min.js"><\/script>')</script>
来源:https://stackoverflow.com/questions/4508786/jquery-tools-fallback-if-cdn-fails