How to do a redirect to the page?

Good afternoon, everyone.

Far from programming, therefore, for someone will seem a silly question but still the answer I need.

There is code:
$(document).ready(function() {

 //E-mail Ajax Send
 $("form").submit(function() { //Change
 var th = $(this);
$.ajax({
 type: "POST",
 url: "mail.php", //Change
 data: th.serialize()
 }).done(function() {
alert("Spasibo");
 setTimeout(function() {
 // The Done Functions
th.trigger("reset");
 }, 1000);
});
 return false;
});

});


How to do a redirect to another page, this code displays a pop-up window, and you need that to just forward
April 19th 20 at 12:48
2 answers
April 19th 20 at 12:50
Solution
$(document).ready(function() {

 //E-mail Ajax Send
 $("form").submit(function() { //Change
 var th = $(this);
$.ajax({
 type: "POST",
 url: "mail.php", //Change
 data: th.serialize()
 }).done(function() {
 document.location.href = "URL";
 setTimeout(function() {
 // The Done Functions
th.trigger("reset");
 }, 1000);
});
 return false;
});

});
April 19th 20 at 12:52
window.location = 'https://toster.ru'

--
or on the php side

<?php
// do something with the form data
header("Location: https://toster.ru");
exit;
?>
Thank you, on the side of php is also needed - alessia_Robel commented on April 19th 20 at 12:55

Find more questions by tags jQueryJavaScript