Erro do IE Javascript: 'target' é nulo ou não é um objeto
document.onkeydown = function(event) {
var tagName = event.target.tagName;
if (tagName != 'INPUT' && tagName != 'TEXTAREA' && !event.alt && event.control) {
if (event.ctrlKey && event.keyCode == 37) {
if (_this.currentPage > 1) {
window.location.href = _this.baseUrl.replace(/%page%/i, _this.currentPage + 1);
}
} else if (event.ctrlKey && event.keyCode == 39) {
if (_this.currentPage < _this.pagesTotal) {
window.location.href = _this.baseUrl.replace(/%page%/i, _this.currentPage - 1);
}
}
}
}
Isso me dá um erro apenas no IE 8:
'target' é nulo ou não é um objeto
para essa linhavar tagName = event.target.tagName;
Como consertar isso. O erro acontece quando pressiono o botão Ctrl ou setas.