我使用了 strophe.archive 插件,但在 Strophe 发送查询后,延迟对象的完成功能似乎是“未定义的”。我还将插件添加到 require.js 的“垫片”中:
var q = $.Deferred();
q = connection.archive.listCollections("user@server.lit");
console.log(q);
q.done(function(){
console.log("DONE");
});
我得到以下跟踪:
Uncaught TypeError: Cannot call method 'done' of undefined test.js:23
Backbone.View.extend.initialize test.js:23
Backbone.View backbone.js:1148
child backbone.js:1393
Backbone.Router.extend.pageTest router.js:92
(anonymous function) backbone.js:900
(anonymous function) backbone.js:1082
_.some._.any underscore.js:193
_.extend.loadUrl backbone.js:1080
_.extend.navigate backbone.js:1125
_.extend.navigate backbone.js:909
Backbone.View.extend.pageTest test1.js:199
jQuery.event.dispatch require-jquery.js:5385
elemData.handle.eventHandle
垫片:
archive: {
deps: ["jquery", "strophe"],
exports: "archive"
},