您的位置:首页 > Web前端 > JavaScript

What is the $ symbol used for in JavaScript

2013-06-26 21:49 519 查看
It doesn't mean anything special.

But because
$
is allowed in identifier names, many Javascript libraries have taken to using
$
as the "central" interface to them, or at least as a shortcut for accessing their functionality.

For example, if you're using jQuery and you say
$("div")
, this is a call to the
$
function with argument "div". When you say
$.post()
, it's calling the
post
method on the
$
object (Javascript is nice in that functions are first-class objects).

from:

http://stackoverflow.com/questions/3107543/what-is-the-symbol-used-for-in-javascript
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐