Want to apply same code on page load and on ajax complete. Below is the code
$(document).ajaxComplete(function() {
showHideBlock();
});
$(document).ready(function() {
showHideBlock();
});
function showHideBlock() {
if ($('.reservationDetails').length == 1) {
$('.user-reservation-info').show();
} else {
$('.user-reservation-info').hide();
}
}
Any other better way of doing it?