Created
February 25, 2013 04:58
-
-
Save ebinnion/5027845 to your computer and use it in GitHub Desktop.
Download and Redirect in jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".downloadLink").click( | |
function(e) { | |
e.preventDefault(); | |
//open download link in new page | |
window.open( $(this).attr("href") ); | |
//redirect current page to success page | |
window.location="www.example.com/success.html"; | |
window.focus(); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @ragineeguptta - It's been 9 years since I wrote this Gist, so I don't recall what exactly I was trying to do here. My best guess after reading this is that I was wanting to:
href
of the linkBut, it's unclear to me.
Do you have something in a shareable state that I could look at?