[Javascript] Javascript error handling using try catch blocks

Peter Brunone peter at brunone.com
Thu Feb 13 10:11:40 CST 2003


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

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of denzil.pereira at iflexsolutions.com
|
|Hi Andy,
|This will work... i have just modifed ur code snippet and added
|the try - catch blocks... hope it helps
|Cheerz
|Denzil
|
|-------------------------------------------------------
|<head>
|<title>New Page 2</title>
|<head>
|<script>
|try
|{
|	document.write('hi there)  // deliberate error
|}
|catch(e)
|{
|	alert("Error occured : " + e.description);
|}
|</script>
|</head>
|<body>
|</body>
|</html>




More information about the Javascript mailing list