News for hackers. Stuff that matters.
Re:Hotlinking to jquery.com will be disabled on January 31, ... by wzdd on Friday December 31, 2010 @10:40AM (#2055601)
> Always seemed to be to be a bad practice from a security point of view

This is why I can't understand people's recommendation to use Google's or Microsoft's CDN. Even if you assume they're not going to be malicious, you have to trust that they're secure. Not to mention that the CDN owner can derive accurate traffic stats from the number of requests for the JavaScript.

Re:Hotlinking to jquery.com will be disabled on January 31, ... by Encosia on Friday December 31, 2010 @11:56AM (#2055772)
As long as the CDN is configured to transmit its files with a far-future expires header (which Google and Microsoft's CDNs are), the CDN owner can't accurately track usage at all.

In a perfect world, the CDN would only handle one HTTP request per user per expires period (+1 year on Google and Microsoft's jQuery CDN). In reality, the file will be pushed out of or cleared from caches for various reasons, but they still persist long enough to make tracking end-usage of the CDN meaningless.

Re:Hotlinking to jquery.com will be disabled on January 31, ... by dminor on Friday December 31, 2010 @11:58AM (#2055779)
Performance. Many of your visitors will already have it in their cache.
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.
Re:Hotlinking to jquery.com will be disabled on January 31, ... by simonbrown on Friday December 31, 2010 @02:27PM (#2056177)
Plenty of people use Google Analytics, which, of course, gives Google just as much access.
Re:Hotlinking to jquery.com will be disabled on January 31, ... by jdminhbg on Friday December 31, 2010 @10:46AM (#2055613)
Why would I be less sure that they're secure than my own personal hosting?
Re:Hotlinking to jquery.com will be disabled on January 31, ... by dfranke on Friday December 31, 2010 @10:49AM (#2055628)
No reason you would be. But you can be sure that your personal hosting is more secure than (your personal hosting ∪ Google). In the latter case if either breaks you're screwed.
Re:Hotlinking to jquery.com will be disabled on January 31, ... by rhizome on Friday December 31, 2010 @12:54PM (#2055926)
You know the components of, and the capacity to upgrade, your own stack. With hotlinking, you (and consequently your users/customers) have an external dependency to a mysterious system with who-knows-what going on.
Re:Hotlinking to jquery.com will be disabled on January 31, ... by lwat on Friday December 31, 2010 @08:41PM (#2057017)
I trust Google and Microsoft enough for the benefits I get in return (faster loading clients). Sure they can screw me over but not too badly. Worth the risk for some applications.