$ and jQuery both point to the window.jQuery object, so they are one and the same. the reason some scripts use jQuery instead of $ is to prevent conflicts with other libraries such as prototype or different versions of jquery which both also use the
$ variable.
Marked as answer by athar_techsavvy on Dec 09, 2012 08:34 AM
By default jquery alias $ to jQuery. But as stated for compatibility with other limbs, you can alias to something else. See jquery noconflict docs. A standard pattern is to use an alias in your own code:
(function($) {
// $ == jQuery
// your code goes here
})(jQuery);
athar_techsa...
Member
554 Points
316 Posts
What is the difference between $ and jQuery?
Dec 08, 2012 12:22 PM|LINK
jQuery("#menu li").removeClass('current');pratikkapadi...
Member
172 Points
32 Posts
Re: What is the difference between $ and jQuery?
Dec 08, 2012 01:00 PM|LINK
$ and jQuery both point to the window.jQuery object, so they are one and the same. the reason some scripts use jQuery instead of $ is to prevent conflicts with other libraries such as prototype or different versions of jquery which both also use the $ variable.
bruce (sqlwo...
All-Star
36686 Points
5438 Posts
Re: What is the difference between $ and jQuery?
Dec 08, 2012 08:57 PM|LINK
By default jquery alias $ to jQuery. But as stated for compatibility with other limbs, you can alias to something else. See jquery noconflict docs. A standard pattern is to use an alias in your own code:
(function($) {
// $ == jQuery
// your code goes here
})(jQuery);