Created
November 28, 2014 03:12
-
-
Save yannisxu/8eabeb723f20a1633427 to your computer and use it in GitHub Desktop.
js download file
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
var downloadURL = function downloadURL(url) { | |
var hiddenIFrameID = 'hiddenDownloader', | |
iframe = document.getElementById(hiddenIFrameID); | |
if (iframe === null) { | |
iframe = document.createElement('iframe'); | |
iframe.id = hiddenIFrameID; | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
} | |
iframe.src = url; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment