Solved

jquery selector no longer working in version 2.1.0.min

Posted on 2014-04-08
7
530 Views
Last Modified: 2014-04-08
Hello Experts,

This selector worked in 1.7.1. min, now I am getting the following error in Chrome.  Does anyone know why?
 
 $('input:checkbox[@id]').filter(function () {



uncaught Error: Syntax error, unrecognized expression: input:checkbox[@id] jquery-2.1.0.min.js:2
0
Comment
Question by:bill_home
  • 4
  • 3
7 Comments
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 39986520
Are you sure? I usually use # not @ for id

 $('input:checkbox[#id]').filter(function () {

Or it's a typo?
0
 

Author Comment

by:bill_home
ID: 39986528
no not a typo
it has been that way for a long time. I searched back releases.
0
 

Author Comment

by:bill_home
ID: 39986534
Here is the code up to the else statement

 function NodeChecked(currentNode) {
                   var id = currentNode.id;
                   var currentCheckbox = $('#' + id);

                   if (currentCheckbox.is(':checked') == true) {

                       // It's a primary node
                       if (id.indexOf('-') <= 0) {

                           $('input:checkbox[@id]').filter(function() {
                               var regex = new RegExp('^' + id + '-');
                               if ($(this).attr('id').match(regex) !== null) {
                                   $(this).prop('checked', true);
                               }
                           });
                       }

                   } else {
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 30

Accepted Solution

by:
Marco Gasi earned 500 total points
ID: 39986551
I found this:

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.

I found it here: http://api.jquery.com/category/selectors/attribute-selectors/
but they are speaking about jquery 1.2 and 1.3. I think your iussue could be similar and even the solution: try to remove the @ symbol and see what happens.
0
 

Author Closing Comment

by:bill_home
ID: 39986571
That was it thanks for the fast response
0
 
LVL 30

Expert Comment

by:Marco Gasi
ID: 39986581
I'm happy to help you, we have been lucky: I never heard about @ in jquery! ;-)
0
 

Author Comment

by:bill_home
ID: 39986602
Every upgrade we find some interesting "changes".  

Thanks Again
Bill
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now