<html>
<link rel="stylesheet" href="josh.css">
<body bgcolor="#FFFFFF">

		<div id="Description">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">throw</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">5</span> ECMA <span class="emphasis">3</span></td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements"></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Triggers an exception condition, passing a value along with the
exception. Although the value you pass can be a simple string,
ideally you should pass an instance of the JavaScript
<span class="literal">Error</span> object filled with sufficient information
for a catch statement to act intelligently on the error. A
<span class="literal">throw</span> statement must be enclosed in the
<span class="literal">try</span> portion of a <span class="literal">try-catch</span>
construction.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="example"><span class="title">Example</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre>function processNumber(inputField) {
    try {
        var inpVal = parseInt(inputField.value, 10);
        if (isNaN(inpVal)) {
            var msg = "Please enter a number only.";
            var err = new Error(msg);
            if (!err.message) {
                err.message = msg;
            }
            throw err;
        }
        // process number
    }
    catch (e) {
        alert(e.message);
        inputField.focus( );
        inputField.select( );
    }
}</pre>
						</span></td>
				</tr>
			</table>
		</div>

</body>
</html>