Rails 3.1、资产管道和 IE 6 & 7 生产模式 - 一些 CSS 和js没有正确加载

发布于 2024-12-22 11:55:02 字数 328 浏览 0 评论 0原文

在生产模式下尝试我的 Rails 3.1 应用程序(Debian 6、Ruby 1.9.2、Passenger)。我使用 IE 6 和 IE 进行了尝试。 IE 7 和某些资源未正确加载。在开发模式下一切正常。

一些CSS和js 未正确加载,所有文件都正在编译。具体来说,我遇到了下拉菜单( jquery superfish 菜单)的问题。在 IE8、IE 9、Firefox、Chrome 中一切正常,无论是在生产环境还是在开发环境中。发展。该问题仅出现在 IE 6 和 IE 中。 7 生产中。

尝试清除缓存(在浏览器和服务器上)。重新编译资产。没有什么可以帮助。

有人遇到过类似的事情吗?

Trying out my Rails 3.1 app in production mode ( Debian 6, Ruby 1.9.2, Passenger). I tried it out using IE 6 & IE 7 and some of the assets are not loaded properly. Everything works fine in dev mode.

Some css & js are not loaded properly, thou all the files are being compiled. Specifally I'm having issues with the drop-down ( jquery superfish menu). Everything works fine in IE8, IE 9, Firefox, Chrome both in production & development. The problem only shows up in IE 6 & 7 in Production.

Tried clearing out cache ( both in browser and on the server). Recompiling assets. Nothing sees to help.

Did anyone run into anything - like that?

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

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

发布评论

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

评论(3

凉世弥音 2024-12-29 11:55:02

对于遇到相同问题的任何人,这里是 MS 支持的问题根源 (http://support.microsoft. com/kb/262161):

出现此问题的原因是以下条件成立
Internet Explorer:前 31 个样式标记之后的所有样式标记都是
未应用。前 4,095 条规则之后的所有样式规则都不是
应用。在使用@import规则持续导入的页面上
导入其他样式表的外部样式表、样式表
深度超过三层的内容将被忽略。

啊啊啊啊啊啊!!!我花了几天时间试图找出我的代码问题,结果又是微软不遵守标准! #@)(!@#)

这促使我进一步调查,令我惊讶的是 IE6 & IE7 似乎只处理一个大 css 文件中的前 2025 行 - 其余的被忽略。 (一开始我以为是行数限制,结果发现是4095条规则,在2025行上)。看起来简直就是愚蠢至极。较新的 IE 和 Chrome、Safari、Opera 和 FF 似乎没有这个问题。我最终将我的 css 分解为 application-1.css & application-2.css 将生产中的文件数量保持在最低限度,但这仍然很烦人。

For anyone having the same problem here is the root of the problem from MS Support (http://support.microsoft.com/kb/262161) :

This problem occurs because the following conditions are true in
Internet Explorer: All style tags after the first 31 style tags are
not applied. All style rules after the first 4,095 rules are not
applied. On pages that uses the @import rule to continously import
external style sheets that import other style sheets, style sheets
that are more than three levels deep are ignored.

ARRRRRRRRRRRRRRR!!! Killed a couple of days trying to track down a problem with my code, when it was MS's non-compliance to standards again!!! #@)(!@#)

This led me to investigate further, and to my amazement IE6 & IE7 seem to process only the first 2025 lines in a big css file - the rest is ignored. ( at first I thought it was a number of lines limitation, but it turns out that it was 4095 rules, that were on the 2025 lines). Just seems plain stupid. Newer IE and Chrome, Safari, Opera and FF don't seems to have a problem with this. I ended up breaking up my css into application-1.css & application-2.css to keep number of the files in produciton to a minimum, but it still very annoying.

慈悲佛祖 2024-12-29 11:55:02

是否启用调试?也就是说,你的 javascript 在开发模式下是分裂的吗?

尝试禁用它,以便资产管道将所有内容合并到同一个文件中,并查看它是否仍然可以在开发模式下工作。

当资源合并在一起并且其中一个文件中缺少分号时,我遇到了一些问题。这可能很难找到,但可能会发生。其他更好的浏览器可以正常渲染它们,但 IE 只是把事情搞混了。

Is debug enabled? i.e. are your javascript split when in development mode?

Try disabling it so the asset pipeline merges everything up in the same file and see if it still works in development mode.

I've had a few issues when the assets were merged together and there was a missing semicolon in one of the files. This might be a hassle to find, but might happen. Other better browsers render them ok, but IE just mix things up.

柳絮泡泡 2024-12-29 11:55:02

有一个很棒的模块 CssSplitter,人们可以使用它来分割 ie 的 css 文件,并且它已被修改为可以从资产管道中使用。 https://gist.github.com/2398394

There is a great module CssSplitter that folks are using to split css files for ie and it has been adapted to be used from the asset pipeline. https://gist.github.com/2398394

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