L Ja
L Ja

Reputation: 1506

jQuery keyup not working in IE7

I am using jQuery and the Datatables plugin. Now I need to do something on a keyup event, but the browser my webpage is designed for doesn't handle the keyup event properly.

Any ideas?

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

It works fine in modern browsers, not in IE7.

Any help would be appreciated.

Upvotes: 1

Views: 102

Answers (1)

Arnaud Gueras
Arnaud Gueras

Reputation: 2062

Have you tried to test if $("input", this.footer()).length>0 ? It seems that the DOM couldn't be completely loaded.

Try to use this :

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

Upvotes: 1

Related Questions