2
我使用strophe.archive插件,但在Strophe發送查詢後,Deferred對象的done函數似乎是「未定義的」。我還增加了插件的require.js的 「墊片」:如何使用strophe.plugins with backbone和require.js
var q = $.Deferred();
q = connection.archive.listCollections("[email protected]");
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"
},
偉大的答案!非常感謝! – genericatz
謝謝,很高興我能幫到你。 –