- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试调试某人的代码,并遇到了这个:
$$$.ajax({
url: ajax_url + param,
context: $("#formDialog"),
success: function(data) {
this.html(data);
BindPopupFormEvents(this, title, reload);
}
}, $$$.ajax.PARTAIL_UPDATE, $mainWrapper);
我们正在使用 jquery 库,但我以前从未见过三重美元符号,而且我不知道它是什么......有什么建议吗?
编辑
我后来发现了这个:
$$$.fn = $$$.prototype = {
init: function(jQuery, test) {},
CONST: CONST
};
我们仅使用 jquery 库,并且在大部分代码中使用单个美元符号。
您能用简单的英语解释一下三美元符号的作用吗?
最佳答案
它只是 jQuery
对象的别名,就像 $
一样。仅此而已...
可以手动或使用 jQuery.noConflict()
完成
示例:
var $$$ = jQuery.noConflict();
var bla = jQuery.noConflict();
现在 $$$
和 bla
都是 jQuery
对象的别名。
<小时/>Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery's case, $ is just an alias for jQuery, so all functionality is available without using $. If we need to use another JavaScript library alongside jQuery, we can return control of $ back to the other library with a call to $.noConflict():
编辑以反射(reflect)您的编辑:
虽然我只看到了一小部分代码,但是 $$$.fn = $$$.prototype
看起来很愚蠢,因为 jQuery.fn
是 的别名>jQuery.prototype
...
来自源代码:
jQuery.fn = jQuery.prototype
关于jquery - jquery中的三美元符号是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10972798/
我是一名优秀的程序员,十分优秀!