GithubHelp home page GithubHelp logo

Not working in IE about jquery-fastlivefilter HOT 5 CLOSED

awbush avatar awbush commented on July 16, 2024
Not working in IE

from jquery-fastlivefilter.

Comments (5)

awbush avatar awbush commented on July 16, 2024

Which version of IE?

On Dec 6, 2011, at 4:40 AM, baroso
[email protected]
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

from jquery-fastlivefilter.

baroso avatar baroso commented on July 16, 2024

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 ...

from jquery-fastlivefilter.

baroso avatar baroso commented on July 16, 2024

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

from jquery-fastlivefilter.

baroso avatar baroso commented on July 16, 2024

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/

from jquery-fastlivefilter.

awbush avatar awbush commented on July 16, 2024

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.

from jquery-fastlivefilter.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.