jquery进度条显示上传文件进度

发布于 2024-09-07 07:52:47 字数 674 浏览 1 评论 0原文

我想使用进度条来显示文件上传进度。 我目前正在使用以下 HTML 代码

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.progressbar.min.js"></script>

$(document).ready(function() {
$("#spaceused1").progressBar();
});

<span class="progressBar" id="spaceused1">25%</span>

<a href="#" onclick="$('#spaceused1').progressBar(20);">20</a>
<a href="#" onclick="$('#spaceused1').progressBar(40);">40</a>
<a href="#" onclick="$('#spaceused1').progressBar(80);">80</a>

当我单击上面的链接时,它工作正常。但现在我该如何显示文件上传进度呢?

请帮帮我。

I want to use progress bar to show file upload progress.
I'm currently using the following code

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.progressbar.min.js"></script>

$(document).ready(function() {
$("#spaceused1").progressBar();
});

HTML:

<span class="progressBar" id="spaceused1">25%</span>

<a href="#" onclick="$('#spaceused1').progressBar(20);">20</a>
<a href="#" onclick="$('#spaceused1').progressBar(40);">40</a>
<a href="#" onclick="$('#spaceused1').progressBar(80);">80</a>

It works fine when i click on the above links. But now how can i use to show the file upload progress?

Please help me out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

从来不烧饼 2024-09-14 07:52:47

您需要使用某种 Flash 上传器,因为这是从 JavaScript 获取进度通知的唯一方法。有一个很好的库,名为 SWFUpload,它有一个 jQuery 包装器 此处

You'll need to use some kind of Flash uploader, as this is the only way to get progress notifications from JavaScript. There's a good library for this called SWFUpload, for which there is a jQuery wrapper here.

转角预定愛 2024-09-14 07:52:47

您将需要使用能够评估已上传文件量的工具 - flash 解决方案是一种可能,但 perl 也可以。

超级上传者

you will need to use something that has the capability of assessing how much of a file has been uploaded already - the flash solution is a possibility but perl is also capable.

uber uploader

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文