News for hackers. Stuff that matters.
Re:Hotlinking to jquery.com will be disabled on January 31, ... by mootothemax on Friday December 31, 2010 @01:14PM (#2055981)
My concern has always been the one-day-in-a-thousand when the CDN will be down and so my sites won't work. When my sites go down it doesn't matter as the entire package stops working, but I'd hate myself ten times more if things stopped working due to an admittedly extremely rare CDN failure.

That said, I'm open to the idea that I'm being extremely foolish about this ;)

Re:Hotlinking to jquery.com will be disabled on January 31, ... by wizard_2 on Friday December 31, 2010 @01:41PM (#2056050)
Stolen from the html5 boilerplate

    <!-- Grab Google CDN's jQuery. fall back to local if necessary -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
    <script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.4.2.js"%3E%3C/script%3E'))</script>
Re:Hotlinking to jquery.com will be disabled on January 31, ... by mootothemax on Friday December 31, 2010 @01:58PM (#2056093)
Superb, thank you! I'm more feeling significantly more enlightened :-D
Re:Hotlinking to jquery.com will be disabled on January 31, ... by adamdecaf on Friday December 31, 2010 @01:32PM (#2056024)
Most users will have the javascript in their cache anyway, so they won't even be hitting the CDN. Also, why not check to see if the object exists before doing anything else?

    <script id="jquery" src="http://code.google.com/jquery.js"></script>
    <script>
    if (jQuery == undefined) {
        document.querySelector("#jquery").src = 'Backup CDN';
    }
    </script>
That should work, in theory, if not then just remove script#jquery, create a new one and append to the document before executing any script(s).
Re:Hotlinking to jquery.com will be disabled on January 31, ... by mootothemax on Friday December 31, 2010 @01:58PM (#2056094)
It's at times like this that I feel really stupid ;) Thanks, you can guess what I'll be changing on my sites the minute I sobered up, err, sometime in the next couple of days ;)
Re:Hotlinking to jquery.com will be disabled on January 31, ... by catshirt on Friday December 31, 2010 @03:32PM (#2056365)
iirc changing the src attribute directly does not resend the request (in at least some browsers). you need to create a new node.