如何让 AJAX 触发浏览器的加载指示器 [英] How to have AJAX trigger the browser's loading indicator
问题描述
我正在制作一个支持 ajax 的实验室调度程序,有些 ajax 操作并不是很快.
I'm making an ajax-enabled lab scheduling program, and some of the ajax operations aren't exactly quick.
在 Gmail 中,当您进入收件箱、发送消息等时,浏览器的行为就像正在加载(在 FF 中,停止按钮已启用,进度条出现),但它不在新页面上,已完成通过 AJAX.
In Gmail, when you go to your inbox, send a message, etc. the browser acts like it's loading (In FF the stop button becomes enabled, the progress bar appears), but it's not on a new page, it's done via AJAX.
他们是怎么做到的?我有一个小旋转指示器,但让浏览器表现得像在加载一样会很好.有什么想法吗?
How do they do this? I have a little spinny indicator, but it would be a nice touch to have the browser act like it's loading. Any ideas?
推荐答案
我认为 这个 是你的答案.(来自显然.com 的反向 AJAX 或慢加载"技术)
I think this is your answer. (Reverse-AJAX or "Slow Load" technique from Obviously.com)
看起来像 GMail 和 Facebook 方法(浏览器将页面显示为正在加载"并带有加载图标等 - 这只是模拟,因为有后台 ajax 请求):)
Looks like the GMail and Facebook method (browser is showing page as "loading" with loading icons etc. - it is just simulating, because there is a background ajax request) :)
这篇关于如何让 AJAX 触发浏览器的加载指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!