Drupal 6 ships with jQuery 1.2.6 but not 1.3.2 is out. Problem is that a lot of modules are using deprecated jQuery selectors that don't work in jQuery 1.3.2.
Can coder look for something like:
$("a[@href*='admin/build/testing']").doSomething();
Specifically looking for this @ symbol.
This works in jQuery 1.2.6 and 1.3.x:
$("a[href*='admin/build/testing']").doSomething();
More detail at http://docs.jquery.com/Selectors/attributeHas#attribute
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | coder_js.patch | 690 bytes | jcmarco |
Comments
Comment #1
jcmarco commentedRelated with this issue #358082: jQuery 1.3 in Drupal 6.x
To help coder work with jQuery 1.3.2 in jQuery Update can we please remove the @ in the selectors. It was depreciated as of 1.2 and removed in 1.3. Change highlighted below.
jQuery 1.2.x:
$("a[@href*='admin/build/testing']").doSomething();
jQuery 1.2.6 and 1.3.x:
$("a[href*='admin/build/testing']").doSomething();
More detail at http://docs.jquery.com/Selectors/attributeHas#attribute
In the coder admin form there is an error running Drupal with JQuery 1.3.2,
as mfer says the use @ selector was deprecated in 1.2.x version, so a good code style should try not to use this selector in .js files,
in fact for D7 that comes with JQuery 1.3.x, using @ selector breaks the javascript execution.
It would be nice to include a style check about finding in any .js file any reference of this kind @xxx= (the more habitual ones are @name= @type=)
Comment #2
stella commented@jcmarco: thanks for the patch, i've committed that to both 6.x-2.x and 7.x branches.
I've added a review for the @ selector in the d6 to d7 reviews in 7.x branch, but leaving this open so it will get added to js reviews soon.
Comment #3
klausiCoder for Drupal 6 is now frozen and only security fixes will be applied. Feel free to update this issue and reopen against 7.x-2.x or 8.x-2.x.