<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>

CC BY-SA 3.0
2015-06-15T14:33:31.270Z
2015-06-15T14:33:31.270Z
Bob Olde Hampsink
<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>

<plugin-development><javascript><tasks>
Detect task is finished
# 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.


---

