Created
October 15, 2016 15:37
-
-
Save anonymous/d9c22cb1f44901b90fe5f3d7a56464ff to your computer and use it in GitHub Desktop.
Image Mass URL Downloader - Javascript
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
function downloadDataUrlFromJavascript(filename, dataUrl) { | |
// Construct the a element | |
var link = document.createElement("a"); | |
link.download = filename; | |
link.target = "_blank"; | |
// Construct the uri | |
link.href = dataUrl; | |
document.body.appendChild(link); | |
link.click(); | |
// Cleanup the DOM | |
document.body.removeChild(link); | |
delete link; | |
} | |
// url links for downloder | |
var links = ['','']; | |
$.each(links, function(k,v){ | |
downloadDataUrlFromJavascript("filename", v); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment