最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin3浏览0评论

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?

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?

Share Improve this question asked Jul 9, 2014 at 10:26 Soe Moe ThuSoe Moe Thu 591 silver badge6 bronze badges 2
  • That error must be ing from other script check the line number of errror and find post the respective code too. this seems to be correct. – Jai Commented Jul 9, 2014 at 10:34
  • Jai, the problem is it doesn't even show which line/which file. In firebug it juz show that 'offsetParent is not set -- cannot scroll' – Soe Moe Thu Commented Jul 9, 2014 at 10:46
Add a ment  | 

1 Answer 1

Reset to default 6

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.

发布评论

评论列表(0)

  1. 暂无评论