O
O
Oleg Galimov2018-02-10 10:24:38
JavaScript
Oleg Galimov, 2018-02-10 10:24:38

Page reload only after click on alert in ajax?

Good time of the day.
Prompt, to make the page reload only after clicking on the alert in ajax?
Here is the ajax code

$.ajax({
  type: "POST",
  cache: false,
  url: ".........php",
  data: { id : id},
  dataType: "json",
  success: function(textstatus){
  alert(textstatus);
  },
  error: function(alert('Problem');}
});

Help with a solution

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Tsvetkov, 2018-02-10
@yellow79

alert is a blocking code execution operation. Just write window.location.reload() on the next line

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question