Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With jQuery 1.8.1, QtWebkit browsers yield "Syntax error, unrecognized expression" on selector #132

Closed
vesath opened this issue Sep 17, 2012 · 7 comments

Comments

@vesath
Copy link

vesath commented Sep 17, 2012

Consider the following HTML page:

<html>
<body>
    <table class="results">
        <thead>
            <tr>
                <th>a</th>
                <th>b</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>1</td>
                <td>2</td>
            </tr>
            <tr>
                <td>2</td>
                <td>1</td>
            </tr>
        </tbody>
    </table>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" src="static/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $(".results").tablesorter();
});
</script>
</body>
</html>

Here, jquery.tablesorter.js can be either version 2.3.11 or the latest master from GIT. And note that the table element is only there so one can test whether tablesorter got successfully loaded by seeing if clicking on "a" or "b" reorders its contents.

In all QtWebkit browsers that I tested (including, for instance, Arora), the above yields:

Error: Syntax error, unrecognized expression: :not([colspan])[data-column="0"]:last,[colspan="1"][data-column="0"]:last

and reordering the table by clicking on its headers therefore does not work; however, the above works perfectly well with Gecko browsers and used to work with all browsers, including QtWebkit, with jquery-1.7.2.

I found out that it can be made to work with QtWebkit and jquery-1.8.1 by replacing the line

h = $headers.filter(':not([colspan])[data-column="' + i + '"]:last,[colspan="1"][data-column="' + i + '"]:last');

in jquery.tablesorter.js by

h = $headers.filter(':not([colspan])[data-column="'+i+'"]');

but my knowledge of selectors is too limited for me to go any further than that.

@thezoggy
Copy link
Collaborator

in 1.8.x sloppy selectors now throw an error.. http://bugs.jquery.com/ticket/12368 / http://bugs.jquery.com/ticket/12299

@thezoggy
Copy link
Collaborator

due to: http://bugs.jquery.com/ticket/12237

@Mottie
Copy link
Owner

Mottie commented Sep 17, 2012

Yeah, I would stick with an older version of jQuery until all of the bugs have been worked out.

I won't change that selector (except for the changes I mentioned in issue #130) because it is needed to make this demo work correctly. And the second part of that selector makes it work properly in IE8.

@toofishes
Copy link

This breaks on the iPhone (iOS 5.1.1, not sure about 6.0.0), as an FYI.

JavaScript: Error
undefined
Error: Syntax error, unrecognized expression:
:not([colspan])[data-column="0"]...

@thezoggy
Copy link
Collaborator

thezoggy commented Oct 1, 2012

yes, known issue with 1.8.x. use 1.7.2 as they dont throw the error. or wait for 1.8.3

@toofishes
Copy link

How would one know we could wait for 1.8.3 for a fix, or is that just a guess? All of the bugs linked here are currently closed; #12368 & #12299 as invalid, #12237 as fixed in 1.8.1.

@Mottie
Copy link
Owner

Mottie commented Nov 14, 2012

This should now be resolved in version 2.4.7, sorry for taking so long to fix it.

@Mottie Mottie closed this as completed Nov 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants