Page 1 of 1

javascritp : window.onerror on IE6

Posted: Thu Jun 10, 2004 8:50 am
by pelegk2
my problem is when i try to catch error like this :


PHP:
--------------------------------------------------------------------------------

window.onerror =handleError;

--------------------------------------------------------------------------------


the error isnt show in the browser but the function
handleError() isnt triggered :


PHP:
--------------------------------------------------------------------------------

function handleError() {
alert("error");

}

--------------------------------------------------------------------------------


but when i do :


PHP:
--------------------------------------------------------------------------------

window.onerror =handleError();

--------------------------------------------------------------------------------


the function IS triggered but immediatly after it i am getting from the browser the message :

quote:
--------------------------------------------------------------------------------
NOT Implemented
--------------------------------------------------------------------------------


why is that?
what to do?
thnaks in advance
peleg

Posted: Thu Jun 10, 2004 9:52 am
by feyd
window.onerror = function(e) { handleError(); }

try that.

Posted: Sat Jun 12, 2004 11:54 pm
by pelegk2
weel i did it but i get a message :
"; is expected"

Posted: Sun Jun 13, 2004 12:03 am
by feyd
put the semi colon after the }.. my bad..

Posted: Sun Jun 13, 2004 12:27 am
by pelegk2
well i added it an there is not error but still my function isnt triggered:(