On Error Resume Next

I need the equivalent for "On Error Resume Next" statement in JavaScript.
LVL 7
smilitaruAsked:
Who is Participating?
 
tejaspuraniCommented:

Try This


<html>
<head>
<title>simple javascript error</title>
<meta http-equiv="Content-Type"
     content="text/html; charset=US-ASCII">
<script type="text/javascript">
<!-- //

function handleError() {
     return true;
}

window.onerror = handleError;
//-->
</script>


</head>
<body onload="doesnotexist()">

</body>
</html>
0
 
tejaspuraniCommented:
send the page what u want to do.
The above function will handle error without popup box
but not resume next.

TP
0
 
Michel PlungjanIT ExpertCommented:
IE5+ and NS6 understands

try {
   something
}
catch (e) {
}

http://developer.netscape.com/docs/manuals/js/core/jsguide15/stmtsov.html#1012168
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
tejaspuraniCommented:
If the function returns true then nothing further happens, if the function returns false then the normal JavaScript error reporting occurs.Which we can handle by  window.onerror = handleError;

It is not possible to resume.

But If we can get the ieda what you need to we can certainly try to do something.

TP

0
 
smilitaruAuthor Commented:
I will give the same amount of points both to tejaspurani  and mplungjan.
Both answers helped me.

mplungjan
Please answer to the new question for you.

Best Regards
0
 
Michel PlungjanIT ExpertCommented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.