jQuery ready function aliases

后端 未结 3 1700
醉话见心
醉话见心 2021-01-05 16:38

I\'m a little confused about all the different ways to create a new jQuery object.

the relevent docs seem to be: http://api.jquery.com/ready/ http://api.jquery.c

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 16:55

    Well if you are only using jQuery then $() is equivalent to jQuery(). So that covers half of them.

    Then, if you use $() instead of $(document).ready, those are the same. In this case, it is just a helper function. You may want to add ready on something else for example, in which case, you would do: $(foo).load({})

    Last, I don't know what you mean with $().ready because you have to pass a parameter.

提交回复
热议问题