[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

ON ERROR RESUME NEXT

Posted on 1999-12-07
12
Medium Priority
?
3,806 Views
Last Modified: 2012-05-04
Is there any expert tell me what is the syntax of (ON ERROR RESUME NEXT) in Javascript ?
0
Comment
Question by:ahchong
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 2

Expert Comment

by:mblase
ID: 2265355
According to my O'Reilly book, there isn't one -- only an Image.onError() method for when an inlined image fails to load.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2265667
and a window.onerror for javascript errors, but that won't help much

Michel
0
 
LVL 1

Accepted Solution

by:
larholm earned 0 total points
ID: 2266991
There is no ON ERROR RESUME NEXT in Javascript, and thanks God!!

When you use ON ERROR RESUME NEXT in, for example, VBScript, when an error occurs nothing happens and the script just proceeds furtheron!

But, if that behavior is what you want, there is a way in Javascript:

window.onerror = null

Just define it as the first line in your Javascript.

However, I would recommend to call an error handling function instead of doing nothing.

window.onerror = checkError

The above will call the function checkError whenever a Javascript error occurs.

/Thor
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2267004
As I suggested.

Michel
0
 
LVL 1

Expert Comment

by:larholm
ID: 2267066
No, you mentioned window.onerror, but didn't give an example of how to use it as ON ERROR RESUME NEXT, which I did.

/Thor
0
 

Author Comment

by:ahchong
ID: 2268218
One question again, how can I use window.onerror in ASP ? is it the same way (I wrote ASP in JavaScript) ?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2269506
asp is serverside - no windows.

Michel
0
 

Author Comment

by:ahchong
ID: 2270612
So... is there any ON ERROR RESUME NEXT in serverside programming like ASP ?
0
 

Author Comment

by:ahchong
ID: 2270616
p/s: ON ERROR RESUME NEXT on Javascript and on serverside
0
 
LVL 2

Expert Comment

by:mblase
ID: 2271631
It looks like Microsoft has indeed included some error-trapping in JScript for server-side use. Look at:

try...catch statement
http://msdn.microsoft.com/scripting/default.htm?/scripting/JScript/doc/jsstmtrycatch.htm

throw statement
http://msdn.microsoft.com/scripting/default.htm?/scripting/JScript/doc/jsstmthrow.htm
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2271722
Good call...

Michel
0
 
LVL 1

Expert Comment

by:larholm
ID: 2273877
Remember to have JScript 5 installed, otherwise try, catch and throw is not supported ;)

/Thor
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…
Suggested Courses

612 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