Your inputs to $.when
aren't of type Deferred
, which is the expected input type for the function - http://api.jquery.com/jQuery.when/
At the simplest level, you could construct Deferred
types with your functions as the beforeStart
construction parameters. Like:
var funcArr = [$.Deferred(funcA), $.Deferred(funcB)];
Here's a working fiddle: http://jsfiddle.net/6MeM5/
Additionally:
If you're just trying to execute each function in an array of functions, you don't need to get Deferred
involved. Just iterate the array using $.each
, like:
$.each(funcArr, function(){
this();
});