Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


JavaScript Throw Statement

javascript throw statement

  • Please log in to reply
 

#1 SmartWeb

SmartWeb

    Senior Member

  • Designer
  • 271 posts

Posted 12 March 2013 - 10:20 PM

The throw statement in JavaScript allows creating custom errors (throw exceptions)
The exception can be any of the following:
a JavaScript String
a number
a boolean
an object.
Ex
catch(err)
{
var y=document.getElementById("XYZ");
y.innerHTML="Error: " custom error message ".";
}

The error here is caught by the catch statement and it displays a custom error message





Also tagged with one or more of these keywords: javascript, throw statement

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users