Javascript examples for DOM:Error
JavaScript Error name Property - ReferenceError, An illegal reference has occurred
<!DOCTYPE html> <html> <body> <h1>JavaScript Errors</h1> <p>You cannot use the value of a non-existing variable:</p> <p id="demo"></p> <script> var x;/* w ww . ja v a 2s . c o m*/ try { x = y + 1; } catch(err) { document.getElementById("demo").innerHTML = err.name; } </script> </body> </html>