dojo更新会导致奇怪的错误

dojo updated causes strange errors

本文关键字:错误 更新 dojo      更新时间:2023-09-26

我最近将我的项目从1.6.1更新到了dojo 1.6.2版本,现在我不断收到奇怪的错误,没有任何代码更改。

Chrome错误控制台:

Error parsing in _ContentSetter#Setter_DIV_0 
 /etermin/js/dojo-release-1.6.2/dojo/../dijit/layout/ContentPane.js:203
Error undefined running custom onLoad code: This deferred has already been resolved 
/etermin/js/dojo-release-1.6.2/dojo/../dijit/layout/ContentPane.js:142

Firefox错误控制台:

dojo.js (vrstica 324)
Error parsing in _ContentSetter#Setter_DIV_0
Error: Could not load class 'dijit.form.FileringSelect
dojo.js (vrstica 372)
Error undefined running custom onLoad code: This deferred has already been resolved

dojo.js文件中有一个问题:如果我把它改回1.6.1,它就会正常工作。但我想使用1.6.2版本的

简单的帮助和建议

更新:我发现了一些奇怪的东西:

  var p = new dijit.MenuItem({
        label: "cut",
    })
  p.onClick = function() {
            dojo.xhrGet({
//some ajax call
});
}

不起作用。但是,如果我在ajax之前只放一个简单的警报,它就会起作用。

 p.onClick = function() {
alert("123");
                dojo.xhrGet({
    //some ajax call
    });
}

为什么不将版本更新到1.9?遗留的dojo迟早不会再工作了,在谷歌托管库中我没有找到1.6.2版本看看:https://developers.google.com/speed/libraries/devguide它还可用吗?你从哪里得到dojo.js?

为了防止菜单的定时问题,您可以定义onClick定义MenuItem。

看看:

var p = new dijit.MenuItem({
    label: "Menu Item With an icon",
    iconClass: "dijitEditorIcon dijitEditorIconCut",
    onClick: function(){alert('i was clicked')}
}));

此致,Miriam

这被报告为一个错误

请在此处查找错误报告。。

您必须修补您的dojo版本或将其升级到1.8或更高版本才能修复它。

如果你知道你在玩什么,你可以手动修复它

补丁位于此处

您可以手动将其应用于当前的dojo构建来修复它。