我正在开发一个使用大量js库并主要使用Express JS的应用程序。 所有代码在Firefox和Chrome中都可以正常工作。但我在IE8和IE9中遇到错误。只在IE8和IE9中发生错误,而不在其他浏览器中
SCRIPT5022: fromText eval for hbs!notification/templates/dropDown failed: SyntaxError: Syntax error in regular expression
http://requirejs.org/docs/errors.html#fromtexteval
require.js, line 138 character 9
SCRIPT5022: fromText eval for hbs!notification/templates/dropDownItem failed: SyntaxError: Syntax error in regular expression
http://requirejs.org/docs/errors.html#fromtexteval
require.js, line 138 character 9
SCRIPT5022: fromText eval for hbs!layouts/admin/templates/teamManagement failed: SyntaxError: Syntax error in regular expression
http://requirejs.org/docs/errors.html#fromtexteval
require.js, line 138 character 9
SCRIPT5022: fromText eval for hbs!layouts/admin/alarms/templates/projectAlarms failed: SyntaxError: Syntax error in regular expression
http://requirejs.org/docs/errors.html#fromtexteval
require.js, line 138 character 9
SCRIPT5022: fromText eval for hbs!admin/templates/navigation failed: SyntaxError: Syntax error in regular expression
http://requirejs.org/docs/errors.html#fromtexteval
require.js, line 138 character 9
SCRIPT5022: fromText eval for hbs!layouts/admin/templates/base failed: SyntaxError: Syntax error in regular expression
http://requirejs.org/docs/errors.html#fromtexteval
require.js, line 138 character 9
这些错误只出现在IE8和IE9中。
这里是我的config.js
require.config({
paths: {
// Require plugins
'text': 'vendor/requirejs-text/text',
'css': 'vendor/css/css',
'hbs': 'vendor/require-handlebars-plugin/hbs',
'Handlebars': 'vendor/require-handlebars-plugin/Handlebars',
'i18nprecompile': 'vendor/require-handlebars-plugin/i18nprecompile',
'json2': 'vendor/require-handlebars-plugin/json2',
// Libraries
'es5shim': 'vendor/es5-shim/es5-shim',
'underscore': 'vendor/underscore/underscore',
'jquery': 'vendor/jquery/jquery',
'jquery.DatePicker': 'vendor/datepicker/datepicker',
'jquery.mousewheel': 'vendor/jquery-mousewheel/jquery.mousewheel',
'backbone': 'vendor/backbone/backbone',
'backbone.virtualCollection': 'vendor/backbone-virtual-collection/backbone.virtual-collection',
'backbone.marionette': 'vendor/backbone.marionette/backbone.marionette',
'backbone.marionette.handlebars': 'vendor/backbone.marionette.handlebars/backbone.marionette.handlebars',
'leaflet': 'vendor/leaflet/leaflet-src',
'highcharts': 'vendor/highcharts/highcharts.src',
'paper': 'vendor/paper/paper',
'handsontable': 'vendor/handsontable/jquery.handsontable',
'walltime': 'vendor/walltime-js/walltime',
'walltime-data': 'vendor/walltime-js/walltime-data'
},
shim: {
'underscore': {
exports: '_'
},
'jquery.DatePicker': {
deps: ['jquery']
},
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'backbone.marionette': {
deps: ['backbone'],
exports: 'Marionette'
},
'backbone.virtualCollection': {
deps: ['backbone', 'underscore']
},
'leaflet': {
exports: 'L'
},
'highcharts': {
deps: ['jquery'],
exports: 'Highcharts'
},
'walltime': {
deps: ['walltime-data']
}
},
hbs: {
i18nDirectory: 'i18n/',
disableI18n: false, // This disables the i18n helper and
// doesn't require the json i18n files (e.g. en_us.json)
// (false by default)
disableHelpers: true, // When true, won't look for and try to automatically load
// helpers (false by default)
helperPathCallback: // Callback to determine the path to look for helpers
function (name) { // ('/template/helpers/'+name by default)
return 'cs!' + name;
},
compileOptions: {} // options object which is passed to Handlebars compiler
}
});
请帮我家伙!
----- 更新 -----
我在Github上发布这是问题的requirejs回购。
你可以找到它here
根据评论,它似乎是问题是在IE9 eval。
我也试图把eval("("+text+")")
作为here,但仍然没有奏效。
任何人都可以请告诉我如何得到这个eval事情在IE9中工作。
感谢
尝试在你的html中添加这个 – Dalorzo
http://stackoverflow.com/questions/5802461/javascript-which-browsers-support-解析的ISO-8601日期字符串与日期标准杆 – Dalorzo
@Dororzo:第一评论没有奏效! – Pratik