通过 Javascript 检查页面是否正在加载某些内容
当浏览器在页面上加载某些内容时,您可以在状态栏中看到它显示“正在等待...”或“正在传输...”等。
在 Firebug 中,您可以在加载某些内容时检查网络选项卡看看它什么时候停止。这就是我想要的。
有没有办法让我在发生这种情况时触发事件?或者获取页面的状态什么的?有什么办法让我知道什么时候会发生变化吗?
我知道如果使用 Ajax,我可以更轻松地完成此操作,但我不能,因为该页面需要 Excel 报告。
谢谢
When the browser is loading something on a page you can see it in the status bar that it says "Waiting for..." or "Transfering..." etc.
In firebug you can check in the net tab when something is being loaded and see when it stops. That is what I want.
Is there a way for me to trigger an event when that happens ? Or to get the status of the page or something ? Any way for me to know when that changes ?
I know I can do this easier if I use Ajax, but I can't since the page it's expecting an Excel report.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在请求页面之前,请执行以下操作:
Before the request for the page, do something like this:
好吧,你可以在 body 标签中使用 onload...或者我错过了什么?
如果您尝试异步加载报表,为什么不使用 AJAX?
Well, you can just use onload in the body tag... or am I missing something?
If you are trying to load the report asynchronously, why not using AJAX?