Click to See Complete Forum and Search --> : preventing error on page


tomas skersys
12-09-2002, 10:13 AM
hello guys,
i got a problem - cannot elliminate one error in my java script. That's not a vital error as the page works fine and i dont have much time to look for it more deeply.

So i just wanted to find out if there's some way to prevent error msg window from popping into surfer's screen? I want to intercept/auto-hide it somehow.

so far i can just hide the error sign in the status bar AFTER the error window kicks in:mad:

/tomas

pyro
12-09-2002, 10:49 AM
Try this. It goes in your <HEAD> tag. Use with caution...It will also block out legitimate errors. :)

<script language="JavaScript">
<!--
function blockError(){return true;}
window.onerror = blockError;
//-->
</script>

tomas skersys
12-09-2002, 10:55 AM
this is the script i've already implemented on my web site... The problem is this script hides error in the status bar... and does not prevent the error window (unless u configure your browser not to show popping up error windows)...

any more ideas ?:(

pyro
12-09-2002, 11:05 AM
Mind posting the code you are using? It might make it easier. Also, I'm not sure if you can eliminate the error message, if one pops up...Some errors only say JavaScript error in the status bar.

tomas skersys
12-09-2002, 11:22 AM
i'm using some menu builder... it's very powerful tool with cool possibilities. and i put too much time into it to make that damn menu working, but it still has 1 bug :mad: And want to hide the error untill i find that bug. So few lines of the whole code wont help in here man :(


i could just do another menu for my site and ease my "sufferings" but i guess i'm too stubborn :)

pyro
12-09-2002, 11:29 AM
I know how that goes...I don't know how to hide error messages if they pop up. Maybe someone else?? One question..If you are using a menu builder, why is there an error? Do you have customized code? If so, that might be the first place to look for errors.

tomas skersys
12-09-2002, 11:35 AM
yeh i had to customize it quite a lot to satisfy my needs :)

btw, one correction - i dont want to HIDE already poped up window. I want to PREVENT it from popping up at all :cool: