Is it just me, or is their analytics JS file down?
Like you I got a 404. Then I remembered I blacklist this adress in /etc/hosts : 0.0.0.0 google-analytics.com Maybe you forgot you do too ?
$.answer=42
21–27 of 27 posts
Re: $.answer=42
#22Earlier quoted context omitted.
var $=function(a){J(1);Z.D[G](Z,[arguments])}; $ is a function object. $.answer is a property of that object. $ itself doesn't really mean anything special in javascript. jQuery and other libraries often use $ as their main object, so it's probably best to avoid using it unless you need to or it's wrapped in another function.
The only thing I've learned in the years that I've been writing Javascript is that the dollar symbol variable is as contentious as the West Bank. Obviously there has to be globals somewhere or else a library ceases to be a library in JS, but I see no problem is using the word jQuery explicitly, or simply passing it into a SEAN/IIFE: (function($) { $('#thing').hide(); })(jQuery);
(function($,undefined) {
"use strict";
...
})(jQuery);
Note the undefined. That's because undefined is not a literal but a variable in JavaScript and can be assigned to anything. This way I ensure that undefined is really undefined and "x === undefined" works. But I digress.Re: $.answer=42
#23Re: $.answer=42
#24Earlier quoted context omitted.
Like you I got a 404. Then I remembered I blacklist this adress in /etc/hosts : 0.0.0.0 google-analytics.com Maybe you forgot you do too ?
How does lack of IP turn into a 404?
Re: $.answer=42
#25Earlier quoted context omitted.
The only thing I've learned in the years that I've been writing Javascript is that the dollar symbol variable is as contentious as the West Bank. Obviously there has to be globals somewhere or else a library ceases to be a library in JS, but I see no problem is using the word jQuery explicitly, or simply passing it into a SEAN/IIFE: (function($) { $('#thing').hide(); })(jQuery);
Yes, that's how you write a jQuery module. That's how I do it: (function($,undefined) { "use strict"; ... })(jQuery); Note the undefined. That's because undefined is not a literal but a variable in JavaScript and can be assigned to anything. This way I ensure that undefined is really undefined and "x === undefined" works. But I digress.
Re: $.answer=42
#26Earlier quoted context omitted.
Like you I got a 404. Then I remembered I blacklist this adress in /etc/hosts : 0.0.0.0 google-analytics.com Maybe you forgot you do too ?
Maybe a little off topic, but what's the purpose for that? Does it make websites that use google analytics unable to track your visit?
Re: $.answer=42
#27Earlier quoted context omitted.
The only thing I've learned in the years that I've been writing Javascript is that the dollar symbol variable is as contentious as the West Bank. Obviously there has to be globals somewhere or else a library ceases to be a library in JS, but I see no problem is using the word jQuery explicitly, or simply passing it into a SEAN/IIFE: (function($) { $('#thing').hide(); })(jQuery);
Yes, that's how you write a jQuery module. That's how I do it: (function($,undefined) { "use strict"; ... })(jQuery); Note the undefined. That's because undefined is not a literal but a variable in JavaScript and can be assigned to anything. This way I ensure that undefined is really undefined and "x === undefined" works. But I digress.
My point was, the battle over the dollar sign single character variable name is stupid.