您何时会看到Jquery美元符号在某物名称的末尾使用 [英] When would you see Jquery dollar sign used at the end of the name of something

查看:86
本文介绍了您何时会看到Jquery美元符号在某物名称的末尾使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么时候看到诸如plot$plot$.getName()之类的名称的末尾使用jQuery美元符号?

When would you see the jQuery dollar sign used at the end of the name of something such as plot$ or plot$.getName()?

当美元符号位于这样的名称的末尾时,这意味着什么?

What does it mean when the dollar sign is at the end of a name like that?

推荐答案

一无所有. $只是标识符中的另一个合法字符,仅此而已.

Nothing, in and of itself. The $ is just another legal character in identifiers, nothing more, nothing less.

也许您正在使用的任何代码库都在名称末尾使用$分配了一些特殊约定,但这并不是标准化的. jQuery(和其他一些库)仅使用$(因为它很方便,简短,并且(当时)相对不太可能用于其他任何用途).

It may be that whatever codebase you're using assigns some special convention to using a $ at the end of the name, but it's nothing standardized. jQuery (and some other libraries) just used $ (on its own) because it was convenient, short, and (at the time) relatively unlikely to be used for anything else.

有时您会在使用jQuery的代码中看到名称开头使用的$,以指示该变量指向jQuery实例.可能是代码正在这样做.但是由于getName不是jQuery函数,可能不是. :-)(除非getName由插件提供.)

You sometimes see the $ used at the beginning of names in code that uses jQuery, to indicate that the variable points to a jQuery instance. It could be the code is doing that. But as getName isn't a jQuery function, probably not. :-) (Unless getName is provided by a plug-in.)

这篇关于您何时会看到Jquery美元符号在某物名称的末尾使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆