[jQuery] mysterious $(window).error behavior

[jQuery] mysterious $(window).error behavior


I can't seem to get $(window).error to work the way it seems like it
should. Have a look at the following page:
http://www.littleshoot.org/errorTest2.html
It includes the following, and neither error is caught by the $
(window).error function -- the alert never happens. Anyone know
what's up?
<script type="text/javascript">
$(document).ready( function() {
$(window).error(function(msg, url, line) {
alert("Got error");
});
throw new Error("Inside doc ready error");
});
throw new Error("Outside doc ready error");
</script>
Thanks.
-Adam Fisk