javascript $ 符号?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5767844/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 18:46:02  来源:igfitidea点击:

javascript $ symbol?

javascript

提问by Ajay Yadav

why $ symbol is used in javascript? i want to know what it specify?

为什么在javascript中使用$符号?我想知道它指定了什么?

回答by Paul

You may be looking at jQuery code. $ is a variable (in jQuery's case it's a shortcut for 'jQuery').

您可能正在查看 jQuery 代码。$ 是一个变量(在 jQuery 的情况下,它是 'jQuery' 的快捷方式)。

回答by Christo

You may well be looking at JavaScript written by a PHP programmer!

您可能正在查看由 PHP 程序员编写的 JavaScript!

回答by duffymo

It's used as a namespace in jQuery. It's also a pseudonym for the jquery object .

它在 jQuery 中用作命名空间。它也是 jquery 对象的化名。