1

Possible Duplicate:
jQuery: $. vs. jQuery

I am too confused in this two types of jquery $('#id') and jQuery('#id').

I have a form and in this form I have included so many jquery files for different functionality. All are working as expected. Now I want to include one more jquery for banners floating and I have configured all setting as displayed.

When I load the page It dispalys this following lines in console

TypeError: $(".side-ads").scrollToFixed is not a function

TypeError: jQuery(".auth").autocomplete is not a function

So I get confused in between this kind of confliction. Is there any way I can remove this confliction ??

Community
  • 1
  • 1
Yogesh Suthar
  • 30,424
  • 18
  • 72
  • 100

2 Answers2

5

$ 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.

jQuery defines a nice solution to resolve conflicts: jQuery.noConflict. By using this function you can define your own name, where jQuery will be accessible.

NullPoiиteя
  • 56,591
  • 22
  • 125
  • 143
3

The reason for the type errors is most likely missing plugins. If you have them, have you included the scripts in your page?

The ScrollToFixed plugin is available here, and Auto Complete is part of jQueryUi.

nick_w
  • 14,758
  • 3
  • 51
  • 71