Edit in JSFiddle

Q.delay(2000)
  .then(function () {
      alert('super!');
   }, function () {
      alert('something went wrong');
   });

              
            
          
            
              
                

              
            
          
            
              

External resources loaded into this fiddle: