Try catch exception : Try Catch « Development « JavaScript Tutorial






<html>
<head>
<title>Try Catch Example</title>
<script type="text/javascript">
try {
    window.nonExistentFunction();
    alert("Method completed.");
} catch (exception) {
    alert("An exception occurred.");
} finally {
    alert("End of trycatch test.");
}
</script>
</head>
<body>
</body>
</html>








4.12.Try Catch
4.12.1.Try catch exception