views:

211

answers:

5

I don't get what jQuery(document) is here. I thought you always used $(document)

see here in his examples: http://sorgalla.com/projects/jcarousel/

+16  A: 

There is no difference. $ is shorthand for jQuery. Sometimes $ is disabled as it may conflict with other Javascript libraries you are using. It is otherwise identical.

cletus
+3  A: 

It's like <? versus <?php: one is a shorthand version that may be vulnerable to conflicts.

chaos
+2  A: 

The $ is just a shortcut for JQuery.

Kevin
+2  A: 

jQuery is just the long-hand way of invoking jQuery. You might want to do this if you are using it in noConflict mode or internally in a plugin to make sure you are using jQuery's $ function instead of another framework's.

tvanfosson
+5  A: 

jQuery uses $(). Prototype uses $(). AFAIK Mootools uses $(). If that was the end of it, it would be impossible to use any combination of the three. So responsible frameworks provide a way to disable $() to avoid conflicts and use something else instead. In jQuery's case, that's jQuery().

jQuery() is recommended over $() for use in jQuery plugins, so they keep functioning if you do disable $().

Macha