drupal7 不能使用美元符号的原因
Drupal 7 更新文档上写到:
Javascript should be made compatible with other libraries than jQuery by adding a small wrapper around your existing code:
这是为了兼容其他的JAVASCRIPT这样做的,
有一个办法可以解决:
(function ($) { // Original JavaScript code. })(jQuery);
可以使用闭包解决
The $ global will no longer refer to the jquery object. However, with this construction,
the local variable $ will refer to jquery, allowing your code to access jQuery through $ anyway,
while the code will not conflict with other libraries that use the $ global.
(function ($) { // Create the tooltips only on document load $(document).ready(function() { // By suppling no content attribute, the library uses each elements title attribute by default $('#content a[href]').qtip({ // Simply use an HTML img tag within the HTML string content: 'dfdfdfdfdf' }); }); })(jQuery);
相关推荐
tztzyzyz 2020-07-05
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18