Goal: I want to use a 'post' method to send a http request to another website (ignore data), and then redirect to another page. Like this,
$.when($.post("https://www.example.com/result") )
.then( $(location).href('page2.html'));
It seems like the redirect process works fine, but not the post process.
I'm sure that my post method is correct, when it stands alone.
But when I put it with the redirect method. It does not work.
I assume that $(location) has been executed while the post method still does not finish yet.
What should I do?
Thank you