Firefox 一直处于“等待”状态 或“从……传输数据”。

发布于 2024-07-17 01:29:57 字数 397 浏览 6 评论 0原文

我有一个网站,其中包含一个 CSS 样式的按钮,用于在悬停时显示不同的图像。 我等待页面完全加载,然后将鼠标移到该按钮上。

Firefox 将显示新图像,但状态栏卡住,显示“正在从 www.server.com 传输数据”或“正在等待 www.server.com”,并且这种情况永远不会消失。 我可以通过 Firebug 的网络视图看到图像在悬停时正确下载,我在任何地方都没有看到其他错误。

什么会导致这种情况? 我这么问是因为我在该页面上遇到后续 Ajax 调用完成脚本的虚假问题。

Firefox 卡住显示此状态是一个常见问题吗? 原因是什么?

I have a website that includes a button which is CSS-styled to show a distinct image on hover. I wait for the page to load completely, then move my mouse over that button.

Firefox will show the new image, but the status bar becomes stuck showing either "transferring data from www.server.com" or "waiting for www.server.com" and this never goes away. I can see via Firebug's net view that the image is correctly downloaded at hover-time, and I see no other errors anywhere.

What can cause this? I am asking because I am having a spurious problem on this page with subsequent Ajax-call completion scripts.

Is it a common problem that Firefox gets stuck showing this status? What are the reasons?

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

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

发布评论

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

评论(4

静待花开 2024-07-24 01:29:57

不知道为什么会卡住,但有更好的方法进行翻转。 将常规图像和悬停图像放在同一图像中。 然后使用 background-position 进行翻转:

a.btn {
  background-image: url("/img/btn.png");
  background-position: 0px 0px;
}
a.btn:active {
  background-position: 0px 50px;
}
a.btn:hover {
  background-position: 0px 25px;
}

上面的 CSS 用于高度为 25px 的三态翻转。 上面的图像只是常规图像; 下面是悬停图像; 下面是活动图像,单击链接时会显示该图像。

这消除了翻转状态更改之间的任何加载延迟。 如果您想变得更奇特,您甚至可以使用 JavaScript 为过渡设置动画(通过包含过渡帧)。

Don't know why it's getting stuck, but there are better methods of doing rollovers. Put both the regular and hover images in the same image. Then use background-position to do the rollover:

a.btn {
  background-image: url("/img/btn.png");
  background-position: 0px 0px;
}
a.btn:active {
  background-position: 0px 50px;
}
a.btn:hover {
  background-position: 0px 25px;
}

The above CSS is for a 3-state rollover with a height of 25px. The top image is just the regular image; beneath that is the hover image; and beneath that is the active image, which is shown when the link is clicked on.

This gets rid of any loading delays between rollover state changes. If you want to get fancy, you can even animate the transitions using JavaScript (by including transition frames).

温柔少女心 2024-07-24 01:29:57

根据操作系统和网络类型,网络连接可能会因以下原因而停止:

  • 客户端上的操作系统仅允许同时打开一定数量的连接。
  • 服务器仅允许来自单个客户端(或 IP 地址)的一定数量的连接。

Firefox 中的默认网络设置应该可以防止 99% 的问题,因为 Firefox 会阻止自己打开过多的服务器连接或过快地打开连接。 另外,如果一切都以健康的方式运行,那么在打开连接失败的情况下,Firefox 会将其将要发出的任何请求排队,并在另一个连接可用时将其发送到另一个连接上,或者类似的事情。

有时代理可能会干扰事物,甚至是您的 ISP 在您不知情的情况下使用的透明代理。 有时,网络上的数据包丢失过多,甚至 TCP 连接也变得不可靠。

然而,根据所描述的症状 - 它似乎完全可重现,我可能会查看服务器。 无论如何,不​​要使用 Firebug 等网络请求,但也要检查服务器日志以查看是否有任何问题。 如果 Web 服务器收到请求但由于某种原因无法为其提供服务,则应记录该情况。

Depending on the operating system and the type of network, a network connection may stall for reasons like:

  • The operating system on the client only allows a certain number of connections to be opened at once.
  • The server only allows a certain number of connections from a single client (or IP address).

The default networking settings in Firefox should prevent 99% of problems, because Firefox prevents itself from opening too many connections to a server or opening connections too quickly. Also, if everything is functioning in a healthy manner, where opening a connection fails Firefox will queue whatever request it was going to make and put it out on another connection when it becomes available, or something like that.

Sometimes proxies can interfere with things, or even transparent proxies which your ISP uses without your knowledge. Sometimes there is just too much packet loss on a network that even TCP connections become unreliable.

However, based on the symptoms described - that it appears to be fully reproducable I'd probably look to the server. By all means nonitor network requests with Firebug and all, but also check server logs to see if anything is going wrong. If the web server received the request but was unable to serve it for some reason, then that should be logged.

孤者何惧 2024-07-24 01:29:57

我不熟悉这个具体问题,但我确实对 Necko(Gecko 运行的网络库)做了一些测试。

如果没有欺骗状态字段的代码,状态栏将向 www.server.com 指示某种网络活动。

您应该仔细检查您的代码,尤其是您可能加载的任何 js 库,以查看是否启动了一些意外的网络功能。

如果您找不到任何明显的东西,您应该转向进行网络跟踪或使用 HTTP 日志记录,取决于哪个对你来说更容易。

如果此时您无法隔离问题,则您可能发现了一个新错误! 不太可能,但这确实发生在我使用该模块期间...您应该按照最新且最好的错误提交规则在 bugzilla.mozilla.org 中提交错误。

I am not familiar with this specific problem, but I did do some testing for Necko, the networking library that Gecko runs on.

Absent some code that is spoofing the status field, the status bar is indicating some kind of networking activity to www.server.com.

You should carefully look through your code, especially any js libraries you might load, to see if there is some unexpected network function that is kicked off.

If you cannot find anything obvious, you should move to doing a network trace or using HTTP logging, depending on which is easier for you.

If you cannot isolate a problem at this point, you may have found a new bug! Very unlikely, but this did happen during my stint on the module... You should file a bug in bugzilla.mozilla.org, following the latest-and-greatest bug filing rules.

如日中天 2024-07-24 01:29:57

您在加载 git.gnome.org 站点时遇到困难,并且在加载过程中陷入困境。 控制台说:
样式表 https://git.gnome.org/browse/cgit_text.css 不是加载是因为它的 MIME 类型“text/html”不是“text/css”。

You are having difficulties loading the git.gnome.org site and are stuck on loading. Console says:
The stylesheet https://git.gnome.org/browse/cgit_text.css was not loaded because its MIME type, "text/html", is not "text/css".

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