Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript try catch

<html>  
<head>Exception Handling</head>  
<body>  
<script>  
try {  
   throw new Error('This is the throw keyword'); //user-defined throw statement.  
}  
catch (e) {  
  document.write(e.message); // This will generate an error message  
}  
</script>  
</body>  
</html>  
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #javascript #catch
ADD COMMENT
Topic
Name
2+8 =