Example explaining Promises and Deferreds in jQuery