[Javascript] Javascript error handling using try catch blocks

denzil.pereira at iflexsolutions.com denzil.pereira at iflexsolutions.com
Thu Feb 13 22:22:47 CST 2003


Hi,

try..catch..finally is supported in IE's version of JavaScript and is supported IE5.xxx upwards. 
And try the following code in IE. Will throw up the error as a JavaScript alert (in the error handling routine.)

Cheerz,
Denzil
-----------------------------------------
Quoting....Peter Brunone" <peter at brunone.com>
Denzil,

	What browser versions support the try... catch syntax?  I had no idea you
could do this in Javascript!  Thanks for helping me learn something new
today :)

-Peter


Code Snippet...
<html>
<head>
<title>New Page 2</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<head>
<script language="JavaScript">
try
{
	abc  //deliberate error
}
catch(e)
{
alert("Error occured : " + e.description);
}
</script>
</head>
<body>
</body>
</html>



More information about the Javascript mailing list