gpt4 book ai didi

javascript - jquery fileDownload 插件 - 显示错误 'offsetParent is not set -- cannot scroll'

转载 作者:行者123 更新时间:2023-11-29 16:12:19 30 4
gpt4 key购买 nike

我正在尝试使用 jquery fileDownload,但它在 firebug 中显示“offsetParent is not set -- cannot scroll”错误。

这是我的代码。很简单。

$.fileDownload("/TmpFiles/Test.pdf")
.done(function () { alert('File download a success!'); })
.fail(function () { alert('File download failed!'); });

谁能帮我解决这个问题?

最佳答案

我遇到了同样的问题。导致此错误的内联 PDF 查看器,所以我所做的是强制 apache 下载 PDF 文件。到目前为止,我用 .htaccess 文件找到了这个解决方案:

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

在您的示例中,您需要将 .htaccess 文件放在/TmpFiles/目录中以将规则应用于 *.pdf 文件。

关于javascript - jquery fileDownload 插件 - 显示错误 'offsetParent is not set -- cannot scroll',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24651176/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com