matthew phung
asked on
JQuery selector help
I'm new to jQuery and need some help understanding what this line of code means, $('.redirect', response).attr('href'). What is '.redirect' ?
$.post(form.attr('action') , data, function (response) {
if ($('.redirect', response).length) {
if ($('.redirect', response).attr('href')) {
window.location.href = $('.redirect', response).attr('href');
} else {
window.location.reload();
}
} else {
loader.hide();
button.removeClass('disabl ed');
message.html(response).sli deDown(300 );
}
});
$.post(form.attr('action')
if ($('.redirect', response).length) {
if ($('.redirect', response).attr('href')) {
window.location.href = $('.redirect', response).attr('href');
} else {
window.location.reload();
}
} else {
loader.hide();
button.removeClass('disabl
message.html(response).sli
}
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Probably after the form is filled and sent it is redirecting to a specific page (thank you page) or else it's reload the page
Is there a reason you gave a 'B' grade?