mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-08 23:14:06 +08:00
48 lines
2.6 KiB
HTML
48 lines
2.6 KiB
HTML
<article class="" id="post-">
|
|
<header class="entry-header">
|
|
<h1 class="entry-title">jQuery.readyException()</h1>
|
|
<div class="entry-meta">
|
|
所属分类:<span class="category"><a href="/category/core/">核心 API</a></span>
|
|
<span class="pull-right">英文文档:<a href="https://api.jquery123.com/jQuery.readyException/" target="_blank">jQuery.readyException()</a></span>
|
|
</div><!-- .entry-meta -->
|
|
</header><!-- .entry-header -->
|
|
<article class="entry method" id="jQuery-readyException1"><h2 class="section-title">
|
|
<span class="name">jQuery.readyException( error )</span><span class="returns">Returns: <a href="http://api.jquery.com/Types/#Selector">Selector</a></span>
|
|
</h2>
|
|
<div class="entry-wrapper">
|
|
<p class="desc"><strong>Description: </strong>Handles errors thrown synchronously in functions wrapped in <code>jQuery()</code>.</p>
|
|
<ul class="signatures"><li class="signature">
|
|
<h4 class="name">
|
|
<span class="version-details">version added: <a href="/category/version/3.1/">3.1</a></span><a href="#jQuery-readyException-error" id="jQuery-readyException-error"><span class="icon-link"></span>jQuery.readyException( error )</a>
|
|
</h4>
|
|
<ul><li>
|
|
<div><strong>error</strong></div>
|
|
<div>Type: <a href="http://api.jquery.com/Types/#Error">Error</a>
|
|
</div>
|
|
<div>An error thrown in the function wrapped in <code>jQuery()</code>.</div>
|
|
</li></ul>
|
|
</li></ul>
|
|
<div class="longdesc" id="entry-longdesc">
|
|
<p>This method is fired when an error is thrown synchronously in a function wrapped in <code>jQuery()</code> or <code>jQuery( document ).ready()</code>, or equivalent. By default it re-throws the error in a timeout so that it's logged in the console and passed to <code>window.onerror</code> instead of being swallowed. Overwrite this method if you want to handle such errors differently.</p>
|
|
</div>
|
|
<section class="entry-examples" id="entry-examples"><header><h2>Example:</h2></header><div class="entry-example" id="example-0">
|
|
<p>Pass the received error to <code>console.error</code>.</p>
|
|
<div class="syntaxhighlighter javascript">
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td class="gutter">
|
|
<div class="line n1">1</div>
|
|
<div class="line n2">2</div>
|
|
<div class="line n3">3</div>
|
|
</td>
|
|
<td class="code">
|
|
<pre><div class="container"><div class="line"><code>jQuery.readyException = <span class="keyword">function</span>( error ) {</code></div></div><div class="container"><div class="line"><code> console.error( error );</code></div></div><div class="container"><div class="line"><code>};</code></div></div></pre>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div></section>
|
|
</div></article>
|
|
</article> |