V
V
Vlad2732020-04-19 09:53:21
JavaScript
Vlad273, 2020-04-19 09:53:21

How to redirect to a page?

Good day to all.

I am far from programming, so for someone the question will seem stupid, but still I need an answer.

There is a 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() {
        // Done Functions
        th.trigger("reset");
      }, 1000);
    });
    return false;
  });

});


How to make a redirect to another page, this code displays a pop-up window, but you just need to redirect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-04-19
@hzzzzl

window.location = 'https://toster.ru'
--
or on the php side

<?php
// что-то делаем с данными формы
header("Location: https://toster.ru");
exit;
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question