It depends on the situation, I prefer to send data to the client, and update the page using the client-side framework, because I have one available. If I were writing my own, and the snippets were small enough, id probably do it server side, keep the js as slim as possible.