Triggering JavaScript from back-end event I'm building a plugin and want to trigger some JavaScript on an event being fired (eg an entry being saved). What is the best way to achieve this? Coming up short looking through the documentation and Stack Overflow.
When an entry is saved, an Entry saved. flash message is set and displayed by Craft. You could use the Control Panel JS plugin to write a script to detect this flash message and perform your desired action.

The flash message is set in a div with an id="notifications". When there is no notification present, this div is empty. When there is a notification present, the div contains another div like this:

&lt;div id="notifications"&gt;
    &lt;div class="notification notice" style="opacity: 0; display: none;"&gt;Entry saved.&lt;/div&gt;
&lt;/div&gt;


If you test for the presence of this inner div and also the specific notification content (i.e. Entry saved.) you should be able to trigger the actions you need to.