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

Not working in IE #3

Closed
baroso opened this issue Dec 6, 2011 · 5 comments
Closed

Not working in IE #3

baroso opened this issue Dec 6, 2011 · 5 comments
Assignees

Comments

@baroso
Copy link

baroso commented Dec 6, 2011

Your Plugin does not seem to work right in IE!

When I call up ...

http://anthonybush.com/projects/jquery_fast_live_filter/comparison/

... and type something, it shows the time but no results!

@awbush
Copy link
Owner

awbush commented Dec 6, 2011

Which version of IE?

On Dec 6, 2011, at 4:40 AM, baroso
reply@reply.github.com
wrote:

Your Plugin does not seem to work right in IE!

When I call up ...

http://anthonybush.com/projects/jquery_fast_live_filter/comparison/

... and type something, it shows the time but no results!


Reply to this email directly or view it on GitHub:
#3

@baroso
Copy link
Author

baroso commented Dec 6, 2011

It does not work at all on IE6 and IE7 because of the following error (on the page)

$("#fastLiveFilter .filter_input").fastLiveFilter("#fastLiveFilter .list_to_filter", {
callback: function(total) { fastLiveFilterNumDisplayed.html(total); },
});

IE6 and IE7 dislike the comma after the callback function ...

$("#fastLiveFilter .filter_input").fastLiveFilter("#fastLiveFilter .list_to_filter", {
callback: function(total) { fastLiveFilterNumDisplayed.html(total); }
});

IE8 ignores this error and seems to filter the list, but does not view the results!

I've not tested it on IE9 ...

@baroso
Copy link
Author

baroso commented Dec 7, 2011

I found the Problem ... IE doesn't know the "textContent" property of the "li" element!!!

http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox

@baroso
Copy link
Author

baroso commented Dec 7, 2011

Here's a quick fix ...

... this ...

        if ((li.textContent || li.innerText || "").toLowerCase().indexOf(filter) >= 0) {

... instead of this ...

        if ((li.textContent || "").toLowerCase().indexOf(filter) >= 0) {

... but this needs to be tested in other Browsers!!!

I tested it and it works in: FF8, IE8, Safari4, Chrome5, Opera11

BEWARE ... you probably should be using the text() method of jQuery ... see the following posts ...

http://stackoverflow.com/questions/6272767/firefoxs-textcontent-doesnt-match-chromes-innertext
http://www.davidtong.me/innerhtml-innertext-textcontent-html-and-text/

@awbush
Copy link
Owner

awbush commented Dec 7, 2011

Thanks, I'll put that in.

I don't really want to use text() because it makes it 2-3 times slower. Accordingly to the posts, it wouldn't be much help for this plug-in anyway (e.g. it's not going to be used to filter <script> tags, and differing behavior with regards to newlines won't affect the filtering process in a meaningful way).

That said, it would be possible to use text() and have it be fast by caching up all the list item selectors, though memory usage may increase slightly in doing so. Will save that as a last recourse.

@awbush awbush closed this as completed in 1805b82 Dec 7, 2011
@ghost ghost assigned awbush Dec 7, 2011
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

2 participants