So I am using an ajax request to post
data into a php script.
At some point, the php script redirects.
Well at least it should be. But it does all kind of weird things
header('Location: index.php');
It get's all the content in index.php and puts it in the callback area.
So I decided to reload the page using javascript. And this is what I got
$.post('booking.php',
{
firstname : $('#firstname').val().trim(),
lastname : $('#lastname').val().trim()
},function(data){
window.location = 'index.php';
$('.notification-booking').html(data);
});
Problem is. There is some feedback being given. What I have up there displays the feedback for a moment then reloads the page. Which woukd be cumbersome if the user hasn't finished reading the text. So I would like to do the following.
- reload the page,
- display the feedback
- Eat a donut and be happy.
In exactly that order I have no. 3 under control. Help out on number 1