网站在所有浏览器中都能完美运行,但 IE: SCRIPT5009: 'Backbone' is undefined
这里是 main.js,它已经花费了很多时间并且似乎符合所有 API 要求?
requirejs.config({
paths: {
// "jquery" : "jquery-1.7.2.min",
"jquery.json" : "jquery.json-2.3.min",
"jquery.jtemplates" : "jquery-jtemplates",
"jquery.nailthumb" : "jquery.nailthumb.1.1.min",
"jquery.ui" : "jquery-ui-1.8.21.custom.min",
"jquery.fileupload" : "jquery-fileupload/jquery.fileupload",
"jquery.iframe-transport" : "jquery-fileupload/jquery.iframe-transport",
"jquery.ui.widget" : "jquery-fileupload/vendor/jquery.ui.widget",
"jquery.fancybox" : "jquery.fancybox",
"handlebars" : "handlebars",
"input" : "input",
"validator" : "cars/modules/carsValidator",
"backbone" : "backbone",
"underscore": "underscore"
},
shim: {
'jquery.jtemplates': {
deps: ['jquery']
},
//exports: "jQuery.fn.setTemplate"
//},
'jquery.json': {
deps: ['jquery'],
exports: "JSON"
},
'jquery.nailthumb':{
deps: ['jquery']
},
'jquery.iframe-transport':{
deps: ['jquery']
},
'jquery.fancybox':{
deps: ['jquery']
},
'input': {
deps: ['jquery']
},
'backbone': {
deps: ['jquery', 'underscore'],
exports: "Backbone"
},
'underscore' :{
exports: '_'
}
}
});
requirejs(["jquery"], function($) {
window.$ = $;
if (typeof console == "undefined") {
this.console = {log: function() {}};
}
//this will invoke the script for the page
if (module){
require([module], function(module){});
}
});
和我的定义电话:
define(["jquery", "backbone"], function ($, backbone) {
return backbone.Model.extend({
update: function (message) {
return this.type(message.type).message(message.message);
},
type: function (type) {
if (type) {
this.set({type: type});
return this;
}
return this.get("type");
},
message: function (message) {
if (message) {
this.set({message: message});
return this;
}
return this.get("message");
}
});
});
任何帮助都会很棒....谢谢