javascritp : window.onerror on IE6

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

javascritp : window.onerror on IE6

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

window.onerror = function(e) { handleError(); }

try that.
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

weel i did it but i get a message :
"; is expected"
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

put the semi colon after the }.. my bad..
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

well i added it an there is not error but still my function isnt triggered:(
Post Reply