문제

This is only happening in Chrome. IE and Firefox work just fine. In the console I get the error: Uncaught TypeError: object is not a function enter image description here

It is saying the error is here but I don't even know where this is:

(function() {with (this[2]) {with (this[1]) {with (this[0]) {return function(event) {onclose()
};}}}})
도움이 되었습니까?

해결책

You have some sort of conflict with that function name.

Try:

window.onclose();

Or even better:

document.getElementById("aerror").addEventListener('click', function() {
    alert('Hello world');
}, false);

You should always use event listeners: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener#Why_use_addEventListener.3F

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top