Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

File download jquery

//
//With jquery.fileDownload.js
//custom use with promises
//
$(document).on("click", "a.fileDownloadPromise", function () {
    $.fileDownload($(this).prop('href'))
        .done(function () { alert('File download a success!'); })
        .fail(function () { alert('File download failed!'); });
 
    return false; //this is critical to stop the click event which will trigger a normal file download
});
Source by jqueryfiledownload.apphb.com #
 
PREVIOUS NEXT
Tagged: #File #download #jquery
ADD COMMENT
Topic
Name
1+2 =