JavaScript Error Reference

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->



JavaScript Error Reference



❮ Previous
Next ❯


Error Object


The Error object provides error information when an error occurs.



Example


In this example we have written "alert" as "adddlert" to
deliberately produce an error.


Return the error name and a description of the
error:



try
  adddlert("Welcome");

catch(err)
  document.getElementById("demo").innerHTML =
  err.name + "<br>" + err.message;

Try it Yourself »


For a tutorial about JavaScript Errors, read our
JavaScript Error Tutorial.




Error Object Properties








Property Description
name Sets or returns an error name
message Sets or returns an error message (a string)

Non-Standard Error Object Properties



Mozilla and Microsoft defines some non-standard error object properties:


fileName (Mozilla)

lineNumber (Mozilla)

columnNumber (Mozilla)

stack (Mozilla)

description (Microsoft)

number (Microsoft)


Do not use these properties in public web sites. They will not work in all browsers.






❮ Previous
Next ❯

Popular posts from this blog

Greenpeace

.name

Thomas Howard, 21st Earl of Arundel