Rails 3.1、资产管道和 IE 6 & 7 生产模式 - 一些 CSS 和js没有正确加载
在生产模式下尝试我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于遇到相同问题的任何人,这里是 MS 支持的问题根源 (http://support.microsoft. com/kb/262161):
啊啊啊啊啊啊!!!我花了几天时间试图找出我的代码问题,结果又是微软不遵守标准! #@)(!@#)
这促使我进一步调查,令我惊讶的是 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) :
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.
是否启用调试?也就是说,你的 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.
有一个很棒的模块 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