say i have a validation of email id using blur() event , im doing this :
$('#email').blur(function(){
//make ajax call , check if duplicate email exist and if duplicate is there do :
$('#email-error').html('duplicate email exisit');
});
however when i use blur() and if im on a input box , click somewhere else (blur event occurs) and if i switch to another tab and again come back to the tab(of the browser) my page freezes, can someone give me an alternative, to this ?
Instead of blur use .change function.The change event is sent to an element when its value changes.Your blur event or focusout event will unnecessary fire ajax request everytime your textbox looses focus whether the data has changed or not.