views:

47

answers:

1

Hi All,

I've been asked to add the HopToad JavaScript Notifier to a site. The JavaScript can be seen here.

What I am wondering is if there is a way that I can set a global error handler for JavaScript / jQuery the way I can with ColdFusion, where any error that occurs, AJAX or just in a function, causes the HopToad.notify(e) function that I need to call.

I've already looked into the .error() and .ajaxError() calls but they dont seem to be what I am looking for.

+2  A: 
<script type="text/javascript">
<!-- //

function handleError() {
    return true;
}

window.onerror = handleError;
//-->
</script>
Aaron Saunders