JavaScript Tutorial/Development/Try Catch

Материал из Web эксперт
Перейти к: навигация, поиск

Try catch exception

   <source lang="javascript">

<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 try�catch test.");

} </script> </head> <body> </body> </html></source>