Skip to content

Instantly share code, notes, and snippets.

@jaxxreal
Created November 5, 2014 19:41
Show Gist options
  • Save jaxxreal/8003b18eaa3bbac8f19a to your computer and use it in GitHub Desktop.
Save jaxxreal/8003b18eaa3bbac8f19a to your computer and use it in GitHub Desktop.
var downloadURL = function (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