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

CommentFileSizeAuthor
#1 coder_js.patch690 bytesjcmarco

Comments

jcmarco’s picture

Category: feature » bug
Status: Active » Needs review
StatusFileSize
new690 bytes

Related 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=)

stella’s picture

Category: bug » feature
Status: Needs review » Active
Issue tags: +js coder review

@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.

klausi’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Coder 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.