总有人间一两风,填我十万八千梦

jQuery .readyException() 用法 手册 | 示例代码

jQuery开发手册 归档 372℃ 0评论

Description: Handles errors thrown synchronously in functions wrapped in jQuery().

  • version added: 3.1jQuery.readyException( error )

    • error
      Type: Error
      An error thrown in the function wrapped in jQuery().

This method is fired when an error is thrown synchronously in a function wrapped in jQuery() or jQuery( document ).ready(), or equivalent. By default it re-throws the error in a timeout so that it's logged in the console and passed to window.onerror instead of being swallowed. Overwrite this method if you want to handle such errors differently.

Example:

Pass the received error to console.error.

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

转载请注明:悠然品鉴 » jQuery .readyException() 用法 手册 | 示例代码

喜欢 (0)or分享 (0)
发表我的评论
取消评论

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址