02/ObjError.html


  1  <?xml version="1.0" encoding="windows-1250"?>
  2  <!DOCTYPE html   PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3    "DTD/xhtml1-strict.dtd">
  4  <html>
  5  <head>
  6    <title>JS ObjError</title>
  7    <meta http-equiv="Author" content="Imrich BURANSKY" />
  8    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1250" />
  9  </head>
 10  
 11  <body>
 12    <h2>Objekt Error</h2>
 13    <script type="text/javascript" >
 14    try
 15    {
 16       throw new Error(77, "Chyba");
 17    }
 18    catch(e)
 19    {
 20       document.write("1. "+ e + "<br />");
 21       document.write("2. "+ e.number + "<br />");
 22       document.write("3. "+ e.description + "<br />");
 23    }
 24    </script>
 25  </body>
 26  </html>
 27  
 28  <!-- ***** Výsledok Internet explorer *****
 29  
 30  Objekt Error
 31  1. [object Error]
 32  2. 77
 33  3. Chyba
 34  
 35  -->
 36  
 37  <!-- ***** Výsledok Mozilla *****
 38  
 39  Objekt Error
 40  1. Error: 77
 41  2. undefined
 42  3. undefined
 43  
 44  -->