jQuery: How can I use “$” instead of “jQuery”?

前端 未结 3 1490
感动是毒
感动是毒 2021-02-11 01:27

I have simple jQuery in my site, yet I keep getting this error:

Uncaught TypeError: Property \'$\' of object [object DOMWindow] is not a function
3条回答
  •  走了就别回头了
    2021-02-11 02:14

    You probably have jQuery noConflict mode enabled somewhere in your code, see: http://api.jquery.com/jQuery.noConflict/

    jQuery.noConflict(); // Stops $ from workng
    

提交回复
热议问题