1

this is simple question. i want to redirect to another page after success in ajax. my code is

if (page != 'Theatres') {
    $('.hexagon').removeClass('active');
    $(this).addClass('active');
    $.ajax({
        url: '{{ url("dashboard/user/set-home-page-preference") }}',
        data: {
            'page': page
        },
        type: 'GET',
        success: function(data) {
            alert(data);
        }
    });
}

i want to redirect to a page after the alert data.

Yosvel Quintero
  • 18,669
  • 5
  • 37
  • 46

1 Answers1

1

Just use window.location.href = "http://stackoverflow.com"; in the success section

see How can I make a page redirect using jQuery?

Community
  • 1
  • 1
nik
  • 2,114
  • 3
  • 22
  • 43