Return to Snippet

Revision: 67006
at July 29, 2014 03:54 by jakob101


Initial Code
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;
};

Initial URL

                                

Initial Description
Uses javascript to create a hidden iframe which downloads the file

Initial Title
Download file using javascript

Initial Tags
javascript, file, download

Initial Language
JavaScript