This is a button that just triggers a partial refresh on a panel on the page:
<xp:button value="Click Me" id="button1"> <xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="panel1" > </xp:eventHandler> </xp:button>
If you go into the page source and click on the tag, you can find an onComplete event in the properties panel:
<xp:button value="Click Me" id="button1"> <xp:eventHandler event="onclick" submit="true" refreshMode="partial" refreshId="panel1" onComplete="alert('hello world');" > </xp:eventHandler> </xp:button>
Then, after you click the button and the partial refresh is executed, the alert will be displayed.
This works well when the client-side code is set to run after a partial refresh event, but be aware that the client-side code will not execute if the event triggers a full refresh because the page gets completely reloaded and the callback to trigger the client-side code goes away with the previous page state.