Get redirect url after ajax get

Hi I am saving a form using jquery ajax.

$.ajax({
     type: "POST",
     url: /admin/department/save,
     data: $(".formstyles").serialize(),
     success: function(data, status,xhr) {
       $(contentHolder).html(data);
}});

When this URL hits it, it saves the form and redirects to /admin/department/edit/1090

This is where ajax get is processed and the response is received.

I want to redirect URLs from request headers, somehow.

+4
source share
1 answer

After success, you can redirect the URL window.location.href = URL;

+2
source

Source: https://habr.com/ru/post/1531137/


All Articles