Skip to content

Commit 9729a4b

Browse files
committed
Types: Added Error
Fixes jquerygh-958 Closes jquerygh-1012
1 parent ee0bd52 commit 9729a4b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pages/Types.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<li class="toclevel-2"><a href="#Proxy_Pattern"><span class="toctext">Proxy Pattern</span></a></li>
8686
</ul>
8787
</li>
88+
<li class="toclevel-1"><a href="#Error"><span class="toctext">Error</span></a></li>
8889
<li class="toclevel-1"><a href="#Selector"><span class="toctext">Selector</span></a></li>
8990
<li class="toclevel-1"><a href="#Event"><span class="toctext">Event</span></a></li>
9091
<li class="toclevel-1"><a href="#Element"><span class="toctext">Element</span></a></li>
@@ -566,8 +567,16 @@ <h2 id="Callback"> Callback </h2>
566567
</code></pre>
567568
<p>Instead of always returning false, the callback could check fields of the form for validity, and return false only when the form is invalid.
568569
</p>
569-
<p><br />
570+
<h2 id="Error"> Error </h2>
571+
<p>An instance of an Error object is thrown as an exception when a runtime error occurs. Error can also be used as base to define user custom exception classes. In JavaScript an error can be thrown as shown below:
572+
</p>
573+
<pre><code data-lang="javascript">throw new Error( "The argument provided is incorrect" );
574+
</code></pre>
575+
<p>An error can also be thrown by the engine under some circumstances. For example, when trying to access a property of <code>null</code>:
570576
</p>
577+
<pre><code data-lang="javascript">var obj = null;
578+
console.log( obj.foo() );
579+
</code></pre>
571580
<h2 id="Selector"> Selector </h2>
572581
<p>A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most cases, the DOM document present in all browsers, but can also be an XML document received via Ajax.
573582
</p>

0 commit comments

Comments
 (0)