On Oct 6, 2009, at 11:02 PM, John Resig wrote:

> You could probably do something like this:
>
> <script src="somecdn.com/jquery.js"></script>
> <script>
> if ( typeof jQuery === "undefined" ) {
>     document.write("<script src='local/jquery.js'></script>");
> }
> </script>
>
> It's not shiny, but it would work - and avoid loading two copies of  
> jQuery.

I took this great idea and went ahead implementing it on a few sites I  
maintain using different syntax.

If you'd like to see the code it's available at: 
<http://snipt.net/pdokas/load-jquery-even-if-the-google-cdn-is-down/ 
 >

--
Phil Dokas -//- [email protected]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to