Example 1 — Ready Callback Throws
A synchronous throw inside $(fn) is passed to readyException.
$(function () {
throw new Error("Ready handler failed");
});
// Default: rethrown in setTimeout → appears in the console How It Works
- Register.
$(fn)schedules the callback for DOM ready. - Throw. The callback throws synchronously.
- Hook. jQuery calls
readyExceptionwith that error.

