/ Published in: JavaScript

Uses javascript to create a hidden iframe which downloads the file
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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; };
Comments
