I’m new to jquery deferreds. Here I have a simple example.
Can anybody tell me why the done function (“now it’s my time”) is fired before the other functions is done?
The guys in this example also create a deferred object and return a promise, so do I.
How must I change my little example to get the done function only fired after this 6 seconds (after the timeout)?
Thanks alot in advance
Wolfgang
You should pass a function to the done() method, but instead you’re calling
console.log()immediately and passing its return value todone(). You should write:Instead of:
You will find an updated fiddle here.