Answers.Body: <p>In one of my plugins I inject a little bit of javascript that polls <code>Craft.cp.runningTaskInfo</code> for changes to detect if a task is finished.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-15T14:33:31.270Z
Answers.LastActivityDate: 2015-06-15T14:33:31.270Z
Answers.UserDisplayName: Bob Olde Hampsink
Body: <p>Is there a way to detect when a task is finished with js, for example I have a task running I can see the progress bar in the top right corner I would like to attach an event so when the task is done to do some js. Is that possible at this stage of craft. Thank you in advance.</p>
  
Tags: <plugin-development><javascript><tasks>
Title: Detect task is finished
ThreadText: # Detect task is finished
  
  (Asked by: username_0 on 2015-06-15)
  
  Is there a way to detect when a task is finished with js, for example I have a task running I can see the progress bar in the top right corner I would like to attach an event so when the task is done to do some js. Is that possible at this stage of craft. Thank you in advance.
  
  **Tags:** plugin-development, javascript, tasks
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-15. Score: 1 | Accepted answer
  
  In one of my plugins I inject a little bit of javascript that polls `Craft.cp.runningTaskInfo` for changes to detect if a task is finished.
  
  
  ---
  
  