What is jQuery(document) vs. $(document)

前端 未结 6 2043
灰色年华
灰色年华 2020-12-01 21:25

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/

6条回答
  •  醉酒成梦
    2020-12-01 22:19

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

提交回复
热议问题