ON ERROR RESUME NEXT

Is there any expert tell me what is the syntax of (ON ERROR RESUME NEXT) in Javascript ?
ahchongAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mblaseCommented:
According to my O'Reilly book, there isn't one -- only an Image.onError() method for when an inlined image fails to load.
0
Michel PlungjanIT ExpertCommented:
and a window.onerror for javascript errors, but that won't help much

Michel
0
larholmCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

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 for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Michel PlungjanIT ExpertCommented:
As I suggested.

Michel
0
larholmCommented:
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
ahchongAuthor Commented:
One question again, how can I use window.onerror in ASP ? is it the same way (I wrote ASP in JavaScript) ?
0
Michel PlungjanIT ExpertCommented:
asp is serverside - no windows.

Michel
0
ahchongAuthor Commented:
So... is there any ON ERROR RESUME NEXT in serverside programming like ASP ?
0
ahchongAuthor Commented:
p/s: ON ERROR RESUME NEXT on Javascript and on serverside
0
mblaseCommented:
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
Michel PlungjanIT ExpertCommented:
Good call...

Michel
0
larholmCommented:
Remember to have JScript 5 installed, otherwise try, catch and throw is not supported ;)

/Thor
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.