I have a simple contact form for download excel file . Main issue happen , When ajax load .I want to download excel file then redirect user to a next page.. Below is my code wit
Method 1 : with jQuery AJAX
Replace your ajax with the following code..
window.open
will open the ajaxexcel.php file in separate window and location.href
will redirect to given welcome.php file.This is the best method for this.
Method 2 : with jQuery filedownload plugin
Just include jqueryfiledownload script and do something like this:
Download
Now when you click on anchor your file is downloaded and you can write your success/failure code in done()/fail()
functions respectively.