View Full Version : jquery callback infinite call

02-25-2010, 08:26 AM

here is one peculiar behavior of jquery callback

$('#mooka').fadeOut(100, function() { sendMail(); } );

and in the head section i have included error handler to display any error if any.

<script>onerror = function(a,b,c) { alert(a+b+c); }</script>
This will alert any dom error with error message, filename and line number.

now i do a fadeout using jquery and i have provided al call back function code.

if there is an error in the sendmail function the error handler function will alert the error.

in this case i made a spelling mistake and the error handler alerted the error when sendmail is called. the error is in sendmail function.

the error alert is coming infinitely. i keep clicking ok but still it appears. then i used taskmanager to close firefox. (another way round is to keep pressing escape and press F5 at one point the page refreshes). This is the case only if the error occured in the callback function of any fadeout.

hope it is clear of what i am explaining.

the fadeout has a callback function which will called after the fadeout is complete. if there is any js dom erros in the callback function my error handler alerts. but it is doing that infinitely.

one way is to disable the error handler. the reason for using that is to debug js errors for all browsers regardless the firebug of firefox and developer tools of IE8.