Solved

On Error Resume Next

Posted on 2002-04-03
6
426 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now