jQuery removes backward compatibility in selector

[@attr] removed from jQuery

There were lot of scripts where I used jQuery selector with using [@attr]. Like if you want to select an input with a name="input_test" , you’d probably write  

$("input[@name=input_test]") to select that input. But it’s removed from releases of 1.3 and later. Now you have to write $("input[name=input_test]") and I have got no problem with removing the @ sign. It should have not been introduced at the first place. Now that there are lot of plugins are written using that and lot of custom scripts on site have used it, jQuery team should have kept a backward compatibility for the @ thing. I upgraded jQuery to latest version 1.3.2 and lately discovered that some features are simply not working. In firebug i was getting uncaught exception.  It took me a little while to understand why they were not working at all. Later i found at http://docs.jquery.com/Selectors writing 

Note: In jQuery 1.3 [@attr] style selectors were removed (they were previously deprecated in jQuery 1.2). Simply remove the ‘@’ symbol from your selectors in order to make them work again.

Then I had to find and replace all the instances where i used the [@attr] thing in the whole site. I could not appreciate this move of jQuery Team. 

Author's gravatar

Md. Mahbubur Rahman

Your email address will not be published. Required fields are marked *