Rails 3.1,资产管道和IE 6& 7在生产模式下-一些CSS& js未正确加载 [英] Rails 3.1, assets pipeline and IE 6 & 7 in production mode - some CSS & js are not loaded properly

查看:73
本文介绍了Rails 3.1,资产管道和IE 6& 7在生产模式下-一些CSS& js未正确加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在生产模式(Debian 6,Ruby 1.9.2,Passenger)中试用我的Rails 3.1应用程序.我使用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.

某些CSS& js加载不正确,您正在编译所有文件.特别是我在下拉菜单(jquery superfish菜单)上遇到了问题. IE8,IE 9,Firefox,Chrome在生产和测试中一切正常.发展.该问题仅在IE 6和更高版本中显示.生产中排名第7.

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.

有人碰到了什么吗?

推荐答案

对于任何有相同问题的人,这里都是来自MS支持部门的问题的根源(

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

发生此问题的原因在于 Internet Explorer:前31个样式标签之后的所有样式标签为 没有申请.前4,095个规则之后的所有样式规则都不是 应用.在使用@import规则连续导入的页面上 导入其他样式表的外部样式表,样式表 超过三个级别的深度将被忽略.

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 !!!在MS再次不符合标准的情况下,花了几天时间试图追踪我的代码问题!!! #@)(!@#)

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!!! #@)(!@#)

这使我进行了进一步的研究,并令我惊讶的是IE6和IE7似乎只处理大型css文件中的前2025行-其余部分将被忽略. (起初我以为这是行数限制,但事实证明,2025行是4095条规则).只是看起来很愚蠢.较新的IE和Chrome,Safari,Opera和FF似乎对此没有问题.我最终将CSS分解为application-1.css& application-2.css可以将生产的文件数量保持在最低水平,但这仍然很烦人.

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.

这篇关于Rails 3.1,资产管道和IE 6& 7在生产模式下-一些CSS& js未正确加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆