jQuery keyup在IE7中不起作用

jQuery keyup not working in IE7

本文关键字:不起作用 IE7 keyup jQuery      更新时间:2023-09-26

我使用的是jQuery和Datatables插件。现在我需要对keyup事件做点什么,但我的网页设计的浏览器无法正确处理keyup事件。

有什么想法吗?

table.columns().every( function () {
var that = this;
    $("input", this.footer()).on("keyup change", function(){
        if ( that.search() !== this.value ) {
            that
                .search( this.value )
                .draw();
        }
    } );
} );

它在现代浏览器中运行良好,而不是在IE7中。

如有任何帮助,我们将不胜感激。

您是否尝试过测试$("input", this.footer()).length>0?DOM似乎无法完全加载。

尝试使用这个:

$(document).ready(function(){
    // Your events binding here
});