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
JavaScript Throw Statement
The throw statement in JavaScript allows creating custom errors (throw exceptions)
The exception can...
javascript throw statement
Also tagged with one or more of these keywords: javascript, throw statement
Web Design →
Javascript →
Comparing Strings in JavaScriptStarted by Salwa, 18 Jul 2013 comparing strings, javascript |
|
|
||
Web Design →
Javascript →
Using OnSubmit in JavaScriptStarted by Salwa, 18 Jul 2013 javascript, onsubmit event |
|
|
||
Web Design →
Javascript →
Downloading Javascript to iPodStarted by OneDes, 13 Jun 2013 downloading, javascript, to ipod |
|
|
||
Web Design →
Javascript →
Downloading JavaScript to BlackBerryStarted by OneDes, 13 Jun 2013 downloading, javascript and 1 more... |
|
|
||
Web Design →
Javascript →
Enabling JavaScript on a MacStarted by OneDes, 13 Jun 2013 enable, javascript, mac |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users