jquery fileDownload plugin - show error 'offsetParent is not set -- cannot scroll'

javascript, jquery

Solution

I had the same issue. The inline PDF viewer causing this error, so what I did is to force the apache to download the PDF file. So far I figured out this solution with .htaccess file:

<FilesMatch "\.(pdf)$">
    <ifModule mod_headers.c>
        Header set Content-disposition "attachment"
    </ifModule>
</FilesMatch>

In your example, you need to place the .htaccess file in the /TmpFiles/ directory to apply the rule to the *.pdf files.

Problem

I am trying to use jquery fileDownload but it's showing 'offsetParent is not set -- cannot scroll' error in firebug. Here is my code. It's simple. ``` $.fileDownload("/TmpFiles/Test.pdf") .done(function () { alert('File download a success!'); }) .fail(function () { alert('File download failed!'); }); ``` Can anyone help me to fix the issue?

Original source