为什么这在IE10和Firefox中有效,但在IE7 / 8中不?
Dojo 1.8版,使用auto-require,使用新的遗漏消息扩展Select ...
define([
"dojo/_base/declare",
"dijit/form/Select",
], function (declare, Select) {
return declare("mydijit.form.Select", [Select], {
missingMessage: "Please answer this.",
postMixInProperties: function(){
this.inherited(arguments);
this._missingMsg = this.missingMessage;
}
});
});
在dojo.js中失败
def (line 1801) => defineModule (line 1546) =>
getModule = function(mid, referenceModule, immediate){
....
match = mid.match(/^(.+?)\!(.*)$/); (line 1013)
出于某种原因,mid未定义。
答案 0 :(得分:1)
发现问题 - 如果仔细查看模块列表,它在列表的末尾包含一个逗号,Internet Explorer 7将其解释为后面跟着一个未定义的字段。 IE的后续版本大步迈进。
define([
"dojo/_base/declare",
"dijit/form/Select"
], function (declare, Select) {
return declare("mydijit.form.Select", [Select], {
missingMessage: "Please answer this.",
postMixInProperties: function(){
this.inherited(arguments);
this._missingMsg = this.missingMessage;
}
});
});