更新时间:2023-12-04 11:01:22
$
是函数,可以称为-$()
.
$()
的行为在很大程度上取决于所提供的参数,尽管下面的所有示例都会返回一个jQuery
对象.它可以:
The behaviour of $()
varies immensely depending on the parameters supplied, although all examples below will return a jQuery
object. It can:
document.ready
处理程序-$(myfunc)
$('<div>')
$()
document.ready
handler - $(myfunc)
$('#myid')
$('<div>')
$()
$
也是一个对象,其中包含各种实用程序功能$.each
,例如该对象的 properties .在这种情况下,这些功能就像 namespace 一样.
$
is also an object that contains various utility functions $.each
, etc as properties of that object. In this context, it acts like a namespace for those functions.