http - jQuery Ajax: redirect to other pages without wait the result -
After clicking on a button I want to fire an Ajax call and then Ajax results without waiting for other pages I want to redirect. Is this possible? Follow my code:
$ ('button'). Click (function () {$ .get ('mailer.php', function) (window.location.replace ("result .php");});});
The above code will wait for the AJAX result before redirection. Can I just walk Ajax on the back and go to other pages?
It seems that the script that you are sending an email is AJAX I can see Waiting for this to happen will be the interval on the end of the user. Here's how I usually solve this problem:
Instead of sending an e-mail to your mailer.fP script, archive the message data in your DB. Do not send e-mail during the AJAX call, this will result in a very quick process for the user.
Then, you can set up a cron job that points to a specially created script to send e-mail stored in DB
Understand?
Comments
Post a Comment