I’m looking for a javascript that allow me to:
1- Create a link: [a href=…
2- The link direct to a download file: domain.com/download/?id=100
3- Once a user clicked on the link (#1)
4- Download started and direct to another page
Is there anyway I can do this without any plugin, just some javascript and how?
Thank you!
What have you tried.
But I will also show you the way.
Create a download link
<a href="download file.zip" onclick="redirect">Download</a>Write a js function:
function redirect(){setTimeout(function(){
window.location.href="new url";
}, 3000);
return true;
}