第一次发帖,还望社区的前辈不吝赐教
最近做一个 rails 项目的浏览器适配,出现了这样的问题: development 模式,一切正常 production 模式,压缩并预编译了 js,然后在 ie8 下就报 js 错误了,但在 chrome 下是正常的
去掉下面的 config.assets.js_compressor = :uglifier,ie8 下就没问题了
config.assets.compile = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
以下是 jquery 源码,控制台中显示报错的位置在下面第一行,错误是'undefined' 为空或不是对象
// Ensure firing before onload, maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", completed );
// A fallback to window.onload, that will always work
window.attachEvent( "onload", completed );
// If IE and not a frame
// continually check to see if the document is ready
var top = false;
try {
top = window.frameElement == null && document.documentElement;
} catch ( e ) {}
困扰一天了,望大神解惑