Javascript IE Fehler: 'Ziel' ist null oder kein Objekt
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);
}
}
}
}
Dies gibt mir nur in IE 8 einen Fehler:
'target' ist null oder kein Objekt
für diese Linievar tagName = event.target.tagName;
Wie man das behebt. Ein Fehler tritt auf, wenn ich die Strg- oder Pfeiltaste drücke.