Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Can calling a complex function inhibit $.when?
- function someFunction(params) {
- //Creates an object
- //$.each(collection, funct() { /*do work on collection, essentially pushes items into an array */});
- //JSON.stringify(results)
- //$.ajax POST...this is what I want $.when to wait for
- }
- $.when(someFunction(params)
- ).then(doNextThing);
- $.when(function() {someFunction(params) }
- ).then(doNextThing);
- function someFunction(params) {
- ...
- return $.ajax(...);
- }
- $.when(someFunction(params)).then(doNextThing);
Add Comment
Please, Sign In to add comment