#12402 closed feature (invalid)
Ability to do $.when(<ajax request 1>).when(<ajax request 2>).then(<ajax callback>);
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Ability to do $.when(<ajax request 1>).when(<ajax request 2>).then(<ajax callback>);
It will be nice!
Change History (5)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
You haven't even described what you want that to do. Please ask for help on a forum, the odds are that you already can do whatever you're asking that to do.
comment:3 follow-up: 4 Changed 10 years ago by
I want to call several ajax requests and when it all will complete, then - call a callback.
I know about $.when(ajax1, ajax2), but when you don't know exactly amount of ajax request - you can not use .when.
comment:4 Changed 10 years ago by
Replying to Oleg <[email protected]…>:
I want to call several ajax requests and when it all will complete, then - call a callback.
I know about $.when(ajax1, ajax2), but when you don't know exactly amount of ajax request - you can not use .when.
Of course, you can use when
:
var arrayOfAjaxRequests = [ ajaxReq1, ajaxReq2, ... ]; $.when.apply( $, arrayOfAjaxRequests );
comment:5 Changed 10 years ago by
Irony: Of course i can use document.getElementById('id'), not $('#id').
But: var w = $.when(); $('img').each(function(){
w.when($.get('/', {img: $(this).attr('src')}));
});
w.then(<ajax callback>);
And you don't need to handle array of deferred objects. I think it will be useful.
Just posting this comment to trak this issue.