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

Support for "Content-type: application/xhtml+xml" #62

Closed
MelTraX opened this issue May 7, 2012 · 5 comments
Closed

Support for "Content-type: application/xhtml+xml" #62

MelTraX opened this issue May 7, 2012 · 5 comments
Labels

Comments

@MelTraX
Copy link

MelTraX commented May 7, 2012

If the browser parses real XHTML the tag names are lowercase. The following lines then break tablesorter:

                thead = t.getElementsByTagName('THEAD')[0],
                trs = thead.getElementsByTagName('TR'),

Since it's a jQuery plugin anyway, I see no reason why not to replace them by this:

                trs = $('thead:eq(0) tr', t).get(),

For me that works like a charm and I just wanted to let you know. :)

@Mottie
Copy link
Owner

Mottie commented May 7, 2012

Hi MelTraX!

LOL nice, I just saw that yesterday and changed it... actually I think I like your method better ;)

Thanks! I'll have this in the next update soon :)

@MelTraX
Copy link
Author

MelTraX commented May 7, 2012

No problem. Thanks for maintaining the project. :)

I just realized though that my solution does not work for nested tables. Hmm, I'm not sure the current version does anyway. I think last time I had to change a few things to make that work. I'll test that tomorrow and let you know.

This change should probably be something like:

                trs = $(t).children('thead:eq(0)').children('tr').get(),

@MelTraX
Copy link
Author

MelTraX commented May 7, 2012

Actually, this one works fine:

                trs = $('> thead:eq(0) tr', t).get(),

I didn't even know that's possible. :D

You should probably test it in a browser that relies on sizzle though.

Mottie added a commit that referenced this issue May 8, 2012
@Mottie
Copy link
Owner

Mottie commented May 8, 2012

I ended up using $(t).find('thead:eq(0) tr') because this jsPref proved it to be the fastest method... even though it is only called once.

@Mottie
Copy link
Owner

Mottie commented May 15, 2012

Too many open issues makes my eye twitch, so I'm sure this issue has been resolved. Thanks! ;)

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

No branches or pull requests

2 participants