Search code examples
jqueryfiltervisual-studio-debugging

jQuery .Filter() only works in debug mode (Chrome and Firefox)


I have a function that works just fine in IE, and while in debug mode, works fine in Chrome and Firefox. It's when the code is not in debug mode where the function does not work in Chrome and Firefox.

$('#search').keyup(function() 
{
    delay(function () {
        var searchText = $('#search').val().toLowerCase().trim();
        $allListElements = $('#qlTable tr'),
        $matchingListElements = $allListElements.filter(function (i, el) {
            filterIndex = $(el).attr('title').toLowerCase().indexOf(searchText) !== -1;
            return filterIndex;
        });
        $allListElements.hide();
        $matchingListElements.show();
    }, 750);
});

Any help would be appreciated.


Solution

  • This was fixed by using the .on("keyup") function instead of .keyup().