Jquery promises whit objects












0















function uploadfiles(inputcontrol){ 
//here the function takes all the files of an input files
//for each inputcontrol.files[i]
//createObject(inputcontrol.files[i]);
}

function createObject(files){
//this function creates an object with each one of them the files
//are processed and loaded in a web service whit AJAX
}

when(uploadfiles()).then(alert('All files uploaded'));


When I run this script, the alert is displayed immediately and it does not wait for the files to be uploaded correctly. How should I run the $ .when?










share|improve this question























  • Are you passing the promises/deferreds back up through createObject and uploadfiles to your when call? See docs for more details.

    – Chris
    Nov 24 '18 at 23:17


















0















function uploadfiles(inputcontrol){ 
//here the function takes all the files of an input files
//for each inputcontrol.files[i]
//createObject(inputcontrol.files[i]);
}

function createObject(files){
//this function creates an object with each one of them the files
//are processed and loaded in a web service whit AJAX
}

when(uploadfiles()).then(alert('All files uploaded'));


When I run this script, the alert is displayed immediately and it does not wait for the files to be uploaded correctly. How should I run the $ .when?










share|improve this question























  • Are you passing the promises/deferreds back up through createObject and uploadfiles to your when call? See docs for more details.

    – Chris
    Nov 24 '18 at 23:17
















0












0








0








function uploadfiles(inputcontrol){ 
//here the function takes all the files of an input files
//for each inputcontrol.files[i]
//createObject(inputcontrol.files[i]);
}

function createObject(files){
//this function creates an object with each one of them the files
//are processed and loaded in a web service whit AJAX
}

when(uploadfiles()).then(alert('All files uploaded'));


When I run this script, the alert is displayed immediately and it does not wait for the files to be uploaded correctly. How should I run the $ .when?










share|improve this question














function uploadfiles(inputcontrol){ 
//here the function takes all the files of an input files
//for each inputcontrol.files[i]
//createObject(inputcontrol.files[i]);
}

function createObject(files){
//this function creates an object with each one of them the files
//are processed and loaded in a web service whit AJAX
}

when(uploadfiles()).then(alert('All files uploaded'));


When I run this script, the alert is displayed immediately and it does not wait for the files to be uploaded correctly. How should I run the $ .when?







jquery web






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 24 '18 at 23:12









LjgazzanoLjgazzano

337




337













  • Are you passing the promises/deferreds back up through createObject and uploadfiles to your when call? See docs for more details.

    – Chris
    Nov 24 '18 at 23:17





















  • Are you passing the promises/deferreds back up through createObject and uploadfiles to your when call? See docs for more details.

    – Chris
    Nov 24 '18 at 23:17



















Are you passing the promises/deferreds back up through createObject and uploadfiles to your when call? See docs for more details.

– Chris
Nov 24 '18 at 23:17







Are you passing the promises/deferreds back up through createObject and uploadfiles to your when call? See docs for more details.

– Chris
Nov 24 '18 at 23:17














2 Answers
2






active

oldest

votes


















1














I updated your clupload class so it can read the file using the Deferred object, because we can now chain the process of reading the file and then upload it.



I also changed the getBase64 function so it returns the Deferred object, this way we can use the done and fail methods later.



Here is the code:



class clupload {
constructor(file, Ticket) {
this.f = file;
this.t = Ticket;
}

readFile () {
var dfd = $.Deferred();
var reader = new FileReader();
reader.onload = function(e) {
dfd.resolve(e.target.result);
};
reader.readAsDataURL(this.f);
return dfd.promise();
}

procesar() {
var tt = this.t;
var nombre = this.f.name;
var user = $('#loginUsrApp').val();
return this.readFile().then(function (salida) {
return $.ajax({
type: "POST",
url: "WebService.asmx/SubirArchivo",
data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + user + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json"
})
});
}
}

function getBase64(f, T) {
var files = document.querySelector(f).files;
var uploads = files.map(function (file) {
var upload = new clupload(file, T);
return upload.procesar();
});
return $.when.apply($, uploads);
}


Now you only have to call it like this:



getBase64('#upload1', r.d).done(function() {
alert('Guardado');
}).fail(function () {
alert('Error');
});





share|improve this answer


























  • I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

    – Ljgazzano
    Nov 26 '18 at 17:31











  • getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

    – kakamg0
    Nov 27 '18 at 7:14











  • I posted the code. any help is very thankful

    – Ljgazzano
    Nov 27 '18 at 15:55











  • @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

    – kakamg0
    Nov 27 '18 at 17:24











  • millions of thanks. Your help has been great!

    – Ljgazzano
    Nov 28 '18 at 0:29



















0














This is de last code, I insert the $ .when into getBase64() function, to test, but it still fails... :(



function getBase64(f, T) {
var totalupload = document.querySelector(f).files.length;
var i;
var r = 0;
for (i = 0; i < totalupload; i++) {
var x = new clupload(document.querySelector(f).files[i], T)
$.when.apply(x.procesar()).done(function () {r= r + 1 });
}
if (r = totalupload) {
alert('Guardado');
} else {
alert('Error');
}

class clupload {

constructor(file, Ticket) {
this.f = file;
this.t = Ticket;
}

procesar() {
var tt = this.t;
var nombre = this.f.name;
var salida = "";
var reader = new FileReader();
reader.readAsDataURL(this.f);
reader.onloadend = function () {
salida = reader.result;
$.ajax({
type: "POST",
url: "WebService.asmx/SubirArchivo",
data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + $('#loginUsrApp').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
return true;
}
})
};
}





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463192%2fjquery-promises-whit-objects%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I updated your clupload class so it can read the file using the Deferred object, because we can now chain the process of reading the file and then upload it.



    I also changed the getBase64 function so it returns the Deferred object, this way we can use the done and fail methods later.



    Here is the code:



    class clupload {
    constructor(file, Ticket) {
    this.f = file;
    this.t = Ticket;
    }

    readFile () {
    var dfd = $.Deferred();
    var reader = new FileReader();
    reader.onload = function(e) {
    dfd.resolve(e.target.result);
    };
    reader.readAsDataURL(this.f);
    return dfd.promise();
    }

    procesar() {
    var tt = this.t;
    var nombre = this.f.name;
    var user = $('#loginUsrApp').val();
    return this.readFile().then(function (salida) {
    return $.ajax({
    type: "POST",
    url: "WebService.asmx/SubirArchivo",
    data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + user + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json"
    })
    });
    }
    }

    function getBase64(f, T) {
    var files = document.querySelector(f).files;
    var uploads = files.map(function (file) {
    var upload = new clupload(file, T);
    return upload.procesar();
    });
    return $.when.apply($, uploads);
    }


    Now you only have to call it like this:



    getBase64('#upload1', r.d).done(function() {
    alert('Guardado');
    }).fail(function () {
    alert('Error');
    });





    share|improve this answer


























    • I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

      – Ljgazzano
      Nov 26 '18 at 17:31











    • getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

      – kakamg0
      Nov 27 '18 at 7:14











    • I posted the code. any help is very thankful

      – Ljgazzano
      Nov 27 '18 at 15:55











    • @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

      – kakamg0
      Nov 27 '18 at 17:24











    • millions of thanks. Your help has been great!

      – Ljgazzano
      Nov 28 '18 at 0:29
















    1














    I updated your clupload class so it can read the file using the Deferred object, because we can now chain the process of reading the file and then upload it.



    I also changed the getBase64 function so it returns the Deferred object, this way we can use the done and fail methods later.



    Here is the code:



    class clupload {
    constructor(file, Ticket) {
    this.f = file;
    this.t = Ticket;
    }

    readFile () {
    var dfd = $.Deferred();
    var reader = new FileReader();
    reader.onload = function(e) {
    dfd.resolve(e.target.result);
    };
    reader.readAsDataURL(this.f);
    return dfd.promise();
    }

    procesar() {
    var tt = this.t;
    var nombre = this.f.name;
    var user = $('#loginUsrApp').val();
    return this.readFile().then(function (salida) {
    return $.ajax({
    type: "POST",
    url: "WebService.asmx/SubirArchivo",
    data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + user + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json"
    })
    });
    }
    }

    function getBase64(f, T) {
    var files = document.querySelector(f).files;
    var uploads = files.map(function (file) {
    var upload = new clupload(file, T);
    return upload.procesar();
    });
    return $.when.apply($, uploads);
    }


    Now you only have to call it like this:



    getBase64('#upload1', r.d).done(function() {
    alert('Guardado');
    }).fail(function () {
    alert('Error');
    });





    share|improve this answer


























    • I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

      – Ljgazzano
      Nov 26 '18 at 17:31











    • getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

      – kakamg0
      Nov 27 '18 at 7:14











    • I posted the code. any help is very thankful

      – Ljgazzano
      Nov 27 '18 at 15:55











    • @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

      – kakamg0
      Nov 27 '18 at 17:24











    • millions of thanks. Your help has been great!

      – Ljgazzano
      Nov 28 '18 at 0:29














    1












    1








    1







    I updated your clupload class so it can read the file using the Deferred object, because we can now chain the process of reading the file and then upload it.



    I also changed the getBase64 function so it returns the Deferred object, this way we can use the done and fail methods later.



    Here is the code:



    class clupload {
    constructor(file, Ticket) {
    this.f = file;
    this.t = Ticket;
    }

    readFile () {
    var dfd = $.Deferred();
    var reader = new FileReader();
    reader.onload = function(e) {
    dfd.resolve(e.target.result);
    };
    reader.readAsDataURL(this.f);
    return dfd.promise();
    }

    procesar() {
    var tt = this.t;
    var nombre = this.f.name;
    var user = $('#loginUsrApp').val();
    return this.readFile().then(function (salida) {
    return $.ajax({
    type: "POST",
    url: "WebService.asmx/SubirArchivo",
    data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + user + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json"
    })
    });
    }
    }

    function getBase64(f, T) {
    var files = document.querySelector(f).files;
    var uploads = files.map(function (file) {
    var upload = new clupload(file, T);
    return upload.procesar();
    });
    return $.when.apply($, uploads);
    }


    Now you only have to call it like this:



    getBase64('#upload1', r.d).done(function() {
    alert('Guardado');
    }).fail(function () {
    alert('Error');
    });





    share|improve this answer















    I updated your clupload class so it can read the file using the Deferred object, because we can now chain the process of reading the file and then upload it.



    I also changed the getBase64 function so it returns the Deferred object, this way we can use the done and fail methods later.



    Here is the code:



    class clupload {
    constructor(file, Ticket) {
    this.f = file;
    this.t = Ticket;
    }

    readFile () {
    var dfd = $.Deferred();
    var reader = new FileReader();
    reader.onload = function(e) {
    dfd.resolve(e.target.result);
    };
    reader.readAsDataURL(this.f);
    return dfd.promise();
    }

    procesar() {
    var tt = this.t;
    var nombre = this.f.name;
    var user = $('#loginUsrApp').val();
    return this.readFile().then(function (salida) {
    return $.ajax({
    type: "POST",
    url: "WebService.asmx/SubirArchivo",
    data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + user + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json"
    })
    });
    }
    }

    function getBase64(f, T) {
    var files = document.querySelector(f).files;
    var uploads = files.map(function (file) {
    var upload = new clupload(file, T);
    return upload.procesar();
    });
    return $.when.apply($, uploads);
    }


    Now you only have to call it like this:



    getBase64('#upload1', r.d).done(function() {
    alert('Guardado');
    }).fail(function () {
    alert('Error');
    });






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 27 '18 at 17:23

























    answered Nov 25 '18 at 1:26









    kakamg0kakamg0

    886412




    886412













    • I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

      – Ljgazzano
      Nov 26 '18 at 17:31











    • getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

      – kakamg0
      Nov 27 '18 at 7:14











    • I posted the code. any help is very thankful

      – Ljgazzano
      Nov 27 '18 at 15:55











    • @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

      – kakamg0
      Nov 27 '18 at 17:24











    • millions of thanks. Your help has been great!

      – Ljgazzano
      Nov 28 '18 at 0:29



















    • I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

      – Ljgazzano
      Nov 26 '18 at 17:31











    • getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

      – kakamg0
      Nov 27 '18 at 7:14











    • I posted the code. any help is very thankful

      – Ljgazzano
      Nov 27 '18 at 15:55











    • @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

      – kakamg0
      Nov 27 '18 at 17:24











    • millions of thanks. Your help has been great!

      – Ljgazzano
      Nov 28 '18 at 0:29

















    I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

    – Ljgazzano
    Nov 26 '18 at 17:31





    I tried this '$.when(getBase64('#upload1', r.d)).then(function () { alert('cargado'); location.reload(); });', but it does the same. It does not wait for the file to load, it shows the message immediately. should I include the WHEN method within the class of the object?

    – Ljgazzano
    Nov 26 '18 at 17:31













    getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

    – kakamg0
    Nov 27 '18 at 7:14





    getBase64('#upload1', r.d) should return a Deferred or Promise or Thenable object. If it's returning a list you should call it like this $.when.apply($, getBase64('#upload1', r.d)).then(...). I need to see the code to be able to help you more.

    – kakamg0
    Nov 27 '18 at 7:14













    I posted the code. any help is very thankful

    – Ljgazzano
    Nov 27 '18 at 15:55





    I posted the code. any help is very thankful

    – Ljgazzano
    Nov 27 '18 at 15:55













    @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

    – kakamg0
    Nov 27 '18 at 17:24





    @Ljgazzano I updated my answer with the code you provided. You probably should have edited your question with the code instead of adding a new answer.

    – kakamg0
    Nov 27 '18 at 17:24













    millions of thanks. Your help has been great!

    – Ljgazzano
    Nov 28 '18 at 0:29





    millions of thanks. Your help has been great!

    – Ljgazzano
    Nov 28 '18 at 0:29













    0














    This is de last code, I insert the $ .when into getBase64() function, to test, but it still fails... :(



    function getBase64(f, T) {
    var totalupload = document.querySelector(f).files.length;
    var i;
    var r = 0;
    for (i = 0; i < totalupload; i++) {
    var x = new clupload(document.querySelector(f).files[i], T)
    $.when.apply(x.procesar()).done(function () {r= r + 1 });
    }
    if (r = totalupload) {
    alert('Guardado');
    } else {
    alert('Error');
    }

    class clupload {

    constructor(file, Ticket) {
    this.f = file;
    this.t = Ticket;
    }

    procesar() {
    var tt = this.t;
    var nombre = this.f.name;
    var salida = "";
    var reader = new FileReader();
    reader.readAsDataURL(this.f);
    reader.onloadend = function () {
    salida = reader.result;
    $.ajax({
    type: "POST",
    url: "WebService.asmx/SubirArchivo",
    data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + $('#loginUsrApp').val() + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (r) {
    return true;
    }
    })
    };
    }





    share|improve this answer




























      0














      This is de last code, I insert the $ .when into getBase64() function, to test, but it still fails... :(



      function getBase64(f, T) {
      var totalupload = document.querySelector(f).files.length;
      var i;
      var r = 0;
      for (i = 0; i < totalupload; i++) {
      var x = new clupload(document.querySelector(f).files[i], T)
      $.when.apply(x.procesar()).done(function () {r= r + 1 });
      }
      if (r = totalupload) {
      alert('Guardado');
      } else {
      alert('Error');
      }

      class clupload {

      constructor(file, Ticket) {
      this.f = file;
      this.t = Ticket;
      }

      procesar() {
      var tt = this.t;
      var nombre = this.f.name;
      var salida = "";
      var reader = new FileReader();
      reader.readAsDataURL(this.f);
      reader.onloadend = function () {
      salida = reader.result;
      $.ajax({
      type: "POST",
      url: "WebService.asmx/SubirArchivo",
      data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + $('#loginUsrApp').val() + "'}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (r) {
      return true;
      }
      })
      };
      }





      share|improve this answer


























        0












        0








        0







        This is de last code, I insert the $ .when into getBase64() function, to test, but it still fails... :(



        function getBase64(f, T) {
        var totalupload = document.querySelector(f).files.length;
        var i;
        var r = 0;
        for (i = 0; i < totalupload; i++) {
        var x = new clupload(document.querySelector(f).files[i], T)
        $.when.apply(x.procesar()).done(function () {r= r + 1 });
        }
        if (r = totalupload) {
        alert('Guardado');
        } else {
        alert('Error');
        }

        class clupload {

        constructor(file, Ticket) {
        this.f = file;
        this.t = Ticket;
        }

        procesar() {
        var tt = this.t;
        var nombre = this.f.name;
        var salida = "";
        var reader = new FileReader();
        reader.readAsDataURL(this.f);
        reader.onloadend = function () {
        salida = reader.result;
        $.ajax({
        type: "POST",
        url: "WebService.asmx/SubirArchivo",
        data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + $('#loginUsrApp').val() + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (r) {
        return true;
        }
        })
        };
        }





        share|improve this answer













        This is de last code, I insert the $ .when into getBase64() function, to test, but it still fails... :(



        function getBase64(f, T) {
        var totalupload = document.querySelector(f).files.length;
        var i;
        var r = 0;
        for (i = 0; i < totalupload; i++) {
        var x = new clupload(document.querySelector(f).files[i], T)
        $.when.apply(x.procesar()).done(function () {r= r + 1 });
        }
        if (r = totalupload) {
        alert('Guardado');
        } else {
        alert('Error');
        }

        class clupload {

        constructor(file, Ticket) {
        this.f = file;
        this.t = Ticket;
        }

        procesar() {
        var tt = this.t;
        var nombre = this.f.name;
        var salida = "";
        var reader = new FileReader();
        reader.readAsDataURL(this.f);
        reader.onloadend = function () {
        salida = reader.result;
        $.ajax({
        type: "POST",
        url: "WebService.asmx/SubirArchivo",
        data: "{T:'" + tt + "',b64:'" + salida + "',N:'" + nombre + "',U:'" + $('#loginUsrApp').val() + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (r) {
        return true;
        }
        })
        };
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 27 '18 at 15:54









        LjgazzanoLjgazzano

        337




        337






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53463192%2fjquery-promises-whit-objects%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks