Tabs bug fix (attrib selector quotes)#596
Tabs bug fix (attrib selector quotes)#596bbodien wants to merge 5 commits intojquerytools:masterfrom
Conversation
…the scrollable rename addItem to appendItem for consistency with new method
|
The next version will be using jQuery 1.7.1 or later as the base and I don't see an issue with the selector if there isn't a quote around them. I can't seem to find it in the jQuery docs either to where it says this is a requirement. Can you perhaps point me to where it says that? I've added the following fiddle to test this in the various browser, Chrome, FF, IE7-9, and it all works fine. |
|
The error arose when using a history push plugin, resulting in an attribute selector for an href value that contained an equals sign:
In this scenario (which I admit is an edge case since you can't have equals signs in element ids, so this could only arise from this kind of history push usage), the quotes around the attribute value are required to avoid ambiguity with the equals signs. In any case, the jQuery docs themselves specify that quotes are mandatory: http://b.ntrn.cc/1X3E0F3h0S3F3v3w3c0W (from http://api.jquery.com/attribute-equals-selector/). See also: http://api.jquery.com/category/selectors/attribute-selectors/ which states:
|
|
Thanks for the info. I was looking thru the change logs but should have just looked at the documentation :) I think it is safe to get this pull request then but only for the selected file. We should also probably have another ticket to go thru the code and add in quotes for all places where it is missing. |
|
Please make this pull request to dev branch instead. |
|
I can confirm the need for attribute selectors due to a recent change in the Facebook API. If you are using Facebook to login you will be redirected to a url like this: If tabs are enabled on the pages upon which the user lands this error occurs: I can confirm that commit 3f29890 fixes the error. Here's a link to the Facebook issue for reference: |
|
Another example on this getting stuck is when using ajax with history together. When the link address has special character (/ or ? which are common on URLs), there will be errors. I think I will just manually update my local version then. |
|
Done inf #679. Though I see you have a feature added here. Please create another pull request just for it if you still want it part of the library. Please follow the guidelines in the wiki. Thanks for helping. |
jQuery 1.5+ requires attribute selector values in selectors to be wrapped in quotes, for example:
$("a[href='#location']")instead of:
$("a[href=#location]")My latest commit here adds single quotes around an attribute value in jQuery Tools Tabs, which was causing uncaught jQuery exceptions.
The other commits in this request pertain to an earlier pull request: #533 but I'm not sure how to only include a specific commit for this request.