Solved

jquery selector no longer working in version 2.1.0.min

Posted on 2014-04-08
7
542 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 31

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 31

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 31

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Reducing the size of certificate chain 2 66
Problem to ToolkitScriptManager 2 52
AutoHotkey ActiveX Component Error 8 74
Need some help with powershell script 5 37
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

863 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

23 Experts available now in Live!

Get 1:1 Help Now