jQuery.readyException()

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

jQuery.readyException(error)🡢 Selector

error ErrorAn 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.

Pass the received error to console.error.

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

Looking for a Web Developer?

👋

Hi! I'm Basti, author of this site. If you are looking for a web developer with 15+ years of experience, holla at me!

Be it the good 'ol jQuery, vanilla JS or modern frameworks like Vue and Svelte, front- or backend, I can help you.

Just write me at jobs@jqapi.com :)