I am have a problem understanding why rejections are not passed on through a promise chain and I am hoping someone will be able to help me understand why. To me, attaching functionality to a chain of promises implies an intent that I am depending o...
I have three HTTP calls that need I need to make in a synchronous manner and how do I pass data from one call to the other?  function first() {    ajax() }  function second() {    ajax() }  function third() {    ajax() }   function main() {     fir...
Problem 1: only one API request is allowed at a given time, so the real network requests are queued while there's one that has not been completed yet. An app can call the API level anytime and expecting a promise in return. When the API call is...
I have 3 processes that needs ajax to complete. But it is asynchronous and it fails to do what I wanted to do..  Lets say:   function a(param1, param2) {      $.post(..., function(result){          if(result){             b();          } else {...
Let's create a simple Deferred object:  defer = $.Deferred( function ( defer ) {     setTimeout( defer.resolve, 3000 ); });   The above Deferred object will be in the "pending" state for 3 seconds, and then switch to the "resolved"...
I really like the idea of jQuery's deferred/promise pattern or paradigm but sometimes I have trouble wrapping my aging brain around the finer points or specific implementation details.  In fact recently I've found that the deferred/promise pa...
I have a function in form:  $.get_members = function() {     var group_id = $('#gid').val();     if($(this).val() == group_id)         return;      var deferr = $.Deferred();      $.get(url)         .done(function() {             ......
the simplest example of what I'm looking for is this:  var messageLoader = $.post("api/user/messages", {api:data})  messageLoader.done(function(data){    //do something  });   This works brilliantly, but only once.  If I want to update th...
So for the past few hours I've been looking into async stuff and using promises. I'm using the testing framework protractor, and theres a few async things I'm having trouble with.   In this save function, I call cm.org1.all() asynchronous...
I am performing multiple batched asynchronous operations in my code. Although operations within a batch should execute asynchronously batches should be executed synchronously one after another.  Here is a jsfiddle I created. Look at the console as al...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.