Link to home
Start Free TrialLog in
Avatar of matthew phung
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('disabled');
                    message.html(response).slideDown(300);
                }
            });
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?