Nested Exception Handling (This script only works with Internet Explorer 5, Navigator 6, or later browsers) : Error Exceptions : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Error Exceptions »

 

Nested Exception Handling (This script only works with Internet Explorer 5, Navigator 6, or later browsers)




<HTML>
<HEAD><TITLE>Exception Test</TITLE></HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function selected(n) {
 try {
  try {
   if (n % == 1throw "Try again"
  }
  catch (ex1) {
   if(ex1 == "Try again")
   return false
  }
  if (n % != 0throw "No way"
 }
 catch (ex2) {
  if(ex2 != "Try again"return false
 }
 return true
}
--></SCRIPT>
<BODY>
<SCRIPT LANGUAGE="JavaScript"><!--
for(i = 1; i <= 100; ++i) {
 if (selected(i)) document.writeln(i+"<BR>")
}
--></SCRIPT>
</BODY>
</HTML>
           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Error Exceptions