Jquery File download ($.fileDownload)

后端 未结 5 917
清酒与你
清酒与你 2021-02-06 04:52

I am using jquery file download ..

the code is as follows :

 function downloadFile(){
var downloadOptions = {
preparingMessageHtml: \"We are preparing y         


        
5条回答
  •  忘掉有多难
    2021-02-06 05:29

    Here is source code of jquery file download ..

    $(function () {
        $(document).on("click", "a.fileDownloadCustomRichExperience", function () {
    
            var $preparingFileModal = $("#preparing-file-modal");
    
            $preparingFileModal.dialog({ modal: true });
    
            $.fileDownload($(this).attr('href'), {
                successCallback: function (url) {
    
                    $preparingFileModal.dialog('close');
                },
                failCallback: function (responseHtml, url) {
    
                    $preparingFileModal.dialog('close');
                    $("#error-modal").dialog({ modal: true });
                }
            });
            return false; //this is critical to stop the click event which will trigger a normal file download!
        });
    });
    
    
    
    
    

提交回复
热议问题