AJAX进度条显示页面加载的加载进度百分比
如何使用进度条显示页面的加载百分比? ...(类似于它们在 Flash 中的显示方式)
谢谢
How do you use a progressbar to show the loading percentage for a page? ...(similar to how they show in flash)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不可能(在没有插件或扩展的 IE8 和 FF3 和 Opera 上)。 如果您想要真实的加载百分比,请包括 HTML + Javascript + 样式表 + 图像。 您只能检测到页面加载了多少文件(此技术只能检测到图像和javascript)。
Impossible(on IE8 & FF3 & Opera without plugin or extension). If you want real loading percentage include HTML + Javascript + Stylesheet + Image. you can only detect how many file loaded to page(only Image & javascript can be detected by this technique).
我想说,如果您需要页面的进度条,则该页面可能需要重新考虑。
就我个人而言,我不喜欢有进度条的页面(例如华硕下载区的进度条)。 他们只是烦人。 我的浏览器已经有进度条了。 我希望我的带宽用于下载该页面,而不是仅告诉我我仍在等待该页面的图形。
不过,当涉及到页面上的 AJAX 请求时,我只会使用某种微调器。 告诉用户有事情发生并且页面没有死。 再说一遍,如果后台请求花费的时间太长以至于您需要进度条,我会再次说后台请求可能应该重新考虑。
I would say that if you need a progressbar for a page, that page might need some rethinking.
Personally I don't like pages that have progress bars (Like the one in the ASUS Download Area). They are just annoying. My browser already have a progressbar. And I would like my bandwidth to be used to download the page and not graphics that would just tell me that I am still waiting for the page.
When it comes to AJAX requests ON a page though, I would just use a spinner thing of some sort. To tell the user that something is going on and that the page is not dead. And again, if the background request takes so long that you would need a progressbar, I would again say that the background request should maybe be rethought.
哦,这么简单,你复制我的代码并粘贴到你的网站上,虽然不是很酷,但仍然可以使用。
代码:
<脚本语言='JavaScript' SRC='http://www.seabreezecomputers.com/tips/progress.js' TYPE='text/javascript'>
oh that so easy, you copy down my code and paste on your website, however is not very cool, but still can use.
CODE :
<SCRIPT LANGUAGE='JavaScript' SRC='http://www.seabreezecomputers.com/tips/progress.js' TYPE='text/javascript'>
</SCRIPT>
嘿,请查看 s3fm 上的上传进度对话框,这是一个免费的在线 Amazon s3 文件管理器。
Hey, check out the upload progress dialog at s3fm, a free online Amazon s3 file manager.