Scenario:
I'd like to load the jQuery and jQuery UI lib from Google's CDN but if they take too long to load, then retrieve it from the local web server.
I'm using Coldfusion but I don't think that is the answer. I think I need to do something with JavaScript.
I wrapped my script src tags with cftry but that did not work.
<cftry>
<!-- Load Jquery from Google -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/<cfoutput>#css_style#</cfoutput>/jquery-ui.css" type="text/css" media="all" />
<cfcatch type="any">
<!-- load from local server -->
<script src="assets/jQuery/jquery-1.7.2.min.js"></script>
<script src="assets/jQueryUI/js/jquery-ui-1.8.7.custom.min.js"></script>
<link rel="stylesheet" href="assets/jQueryUI/css/<cfoutput>#css_style#</cfoutput>/jquery-ui-1.8.7.custom.css" type="text/css" media="all" />
</cfcatch>
</cftry>