.when() is not working with ajax call
Hi,
My code looks like this:
-
- $.when(myAjaxFunction()).done(function(myMessage){
- alert(myMessage);
- });
In this case, I'm getting an error that myMessage is undefined. How can I make sure that the
myAjaxFunction() is executed and completed before I display myMessage. I thought .when() was designed for this scenario but it's not working.
Any idea why?
Thanks,
Sam