Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8752321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:12:38+00:00 2026-06-13T13:12:38+00:00

I use the strophe.archive plugin but the done function of the Deferred object seems

  • 0

I use the strophe.archive plugin but the done function of the Deferred object seems to be “undefined” after Strophe sends the query. I also added the plugin to the “shim” of require.js:

        var q = $.Deferred();     
        q = connection.archive.listCollections("user@server.lit");
        console.log(q);
        q.done(function(){
            console.log("DONE");
        });

I get the following trace:

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

shim:

  archive: {
      deps: ["jquery", "strophe"],
      exports: "archive"
  },
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:12:39+00:00Added an answer on June 13, 2026 at 1:12 pm

    You invoke a deferred obj and assign it to q, and then you assign the result of listCollections to q. These are two different and completely unrelated assignments. Just because you made q a deferred initially doesn’t mean that the result from listCollections is now somehow deferrable.

        var q = $.Deferred();  // q is a deferred obj
        q = connection.archive.listCollections("user@server.lit"); // q is undefined
    

    listCollections must return a deferred object for you to be able to call done on it.

    Looking at the plugin code, it looks like listCollections doesn’t return anything.

    Instead, you must pass listCollections a callback function:

        var q = $.Deferred();     
        q = connection.archive.listCollections("user@server.lit", null, function(){
            console.log("DONE");
        });
    

    Alternatively, you can make a wrapper function for listCollections that will return a deferred.

        function deferrableListCollections () {
            var q = $.Deferred();     
            connection.archive.listCollections("user@server.lit", null, function(){
                q.resolve() ;
            });
            return q;
        }
    

    No you can call something similar to your original code:

        q = deferrableListCollections("user@server.lit");
        q.done(function(){
            console.log("DONE");
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I use the strophe.pubsub plugin to configure a node for multiple publishers
use Text::Diff; for($count = 0; $count <= 1000; $count++){ my $data_dir=archive/oswiostat/oracleapps.*dat; my $data_file= `ls
I'm starting to learn strophe library usage and when i use addHandler to parse
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
I need to use the publish subscribe service of Strophe to access nodes my
Use case: we have some project meta-data files which we want tracked, but are
I'm playing around with strophe and Openfire 3.7.1 (with user-service and monitoring plugin). I've
use ThreadPool.QueueUserWorkItem (WaitCallback, Object) to start a thread with my target method and data.
use a reapeter to display data, but sometimes the data is to big to
Use of function calls in where clause of stored procedure slows down performance in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.