View Single Post
Old 01-30-2013, 10:29 PM   PM User | #9
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,554
Thanks: 9
Thanked 480 Times in 463 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by felgall View Post
When using JQuery $ should be the only global JavaScript variable in the page.
nope, jQuery is defined also.


@sunfighter:
often some jerk/library decides to use "$", and then adds jQuery to the site. using window.jQuery ensures that you don't mis-apply the unexpected $ var as though it were jQuery.


quick aside:
i like to use self instead of window to hit globals so that the code can run in WebWorker threads if needed and it's less to type.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:15.2% IE7:0.5% IE8:8.4% IE9:8.5% IE10:8.5%

Last edited by rnd me; 01-30-2013 at 10:31 PM..
rnd me is offline   Reply With Quote