Solved

On Error Resume Next

Posted on 2002-04-03
6
427 Views
Last Modified: 2008-02-26
I need the equivalent for "On Error Resume Next" statement in JavaScript.
0
Comment
Question by:smilitaru
  • 3
  • 2
6 Comments
 
LVL 3

Accepted Solution

by:
tejaspurani earned 50 total points
ID: 6916000

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
 
LVL 3

Expert Comment

by:tejaspurani
ID: 6916029
send the page what u want to do.
The above function will handle error without popup box
but not resume next.

TP
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 6916045
IE5+ and NS6 understands

try {
   something
}
catch (e) {
}

http://developer.netscape.com/docs/manuals/js/core/jsguide15/stmtsov.html#1012168
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 3

Expert Comment

by:tejaspurani
ID: 6916060
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
 
LVL 7

Author Comment

by:smilitaru
ID: 6917624
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 6917628
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question