Created
June 17, 2015 09:59
-
-
Save gpprojekt-marcin/25f51b0a70e8fe69cf20 to your computer and use it in GitHub Desktop.
jQuery.ajax() download pdf
This file contains 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
$.ajax({ | |
url: url, | |
data: data, | |
success: function (data) { | |
var blob = new Blob([data]); | |
var link = document.createElement('a'); | |
link.href = window.URL.createObjectURL(blob); | |
link.download = "Dossier.pdf"; | |
link.click(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much for this. You saved my day!