Skip to content


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

vesath opened this Issue · 7 comments

4 participants


Consider the following HTML page:

    <table class="results">
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="static/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function() {

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.


in 1.8.x sloppy selectors now throw an error.. /


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.


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

JavaScript: Error
Error: Syntax error, unrecognized expression:

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


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.


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

@Mottie Mottie closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.