我正在使用 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
});
关于javascript - jQuery keyup 在 IE7 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33363361/