Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have created the <a href="http://johnculviner.com/post/2012/03/22/Ajax-like-feature-rich-file-downloads-with-jQuery-File-Download.aspx" rel="noreferrer">jQuery File Download plugin</a> (<a href="http://jqueryfiledownload.apphb.com/" rel="noreferrer">Demo</a>) (<a href="https://github.com/johnculviner/jquery.fileDownload" rel="noreferrer">GitHub</a>) which could also help with your situation. It works pretty similarly with an iframe but has some cool features that I have found quite handy:</p> <ul> <li><p>Very easy to setup with nice visuals (jQuery UI Dialog, but not required), everything is tested too</p></li> <li><p>User never leaves the same page they initiated a file download from. This feature is becoming crucial for modern web applications</p></li> <li><p>successCallback and failCallback functions allow for you to be explicit about what the user sees in either situation</p></li> <li><p>In conjunction with jQuery UI a developer can easily show a modal telling the user that a file download is occurring, disband the modal after the download starts or even inform the user in a friendly manner that an error has occurred. See the <a href="http://jqueryfiledownload.apphb.com/" rel="noreferrer">Demo</a> for an example of this. Hope this helps someone!</p></li> </ul> <p>Here is a simple use case demo using the plugin <a href="http://github.com/johnculviner/jquery.fileDownload/blob/master/src/Scripts/jquery.fileDownload.js" rel="noreferrer">source</a> with promises. The <a href="http://jqueryfiledownload.apphb.com/" rel="noreferrer">demo page</a> includes many other, 'better UX' examples as well.</p> <pre><code>$.fileDownload('some/file.pdf') .done(function () { alert('File download a success!'); }) .fail(function () { alert('File download failed!'); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload