jQuery jQuery.readyException()Method

jQuery 杂项方法jQuery Miscellaneous Methods

Examples

Pass the received error to console.error

jQuery.readyException = function( error ) { console.error( error ); };


Definition and Usage

The $.readyException() function handles errors thrown synchronously by functions wrapped in jQuery().


Note:1. This method is triggered when a function wrapped in jQuery() or jQuery( document ).ready(), or an equivalent function, throws an error synchronously. By default, it re-throws the error so that it is logged in the console and passed to window.onerror.


Syntax

$.readyException( error )

Parameters Description
error Error type: An error thrown by a function wrapped in jQuery()


jQuery 杂项方法jQuery Miscellaneous Methods

Other Extensions