【发布时间】:2013-06-06 13:24:34
【问题描述】:
我有一个在 IE 中运行良好的功能,在调试模式下,在 Chrome 和 Firefox 中运行良好。当代码未处于调试模式时,该功能在 Chrome 和 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);
});
任何帮助将不胜感激。
【问题讨论】:
-
如果需要,这里是延迟函数的代码:
var delay = (function(){ var timer = 0; return function(callback, ms){ clearTimeout (timer); timer = setTimeout(callback, ms); }; })();
标签: jquery filter visual-studio-debugging