There isn't a one stop 'shopping' (he he) way to do it but it can be done.
In Shopify items are added to the cart either via a a regular HTML form POST to '/cart/add' or via Ajax so broadly speaking you'll need to account for both. Further, when using Ajax theme developers can either use the Shopify Ajax API or go for a straight up Ajax POST.
In the first case what you can do is add a submit handler to the form on page load so you'll be able to pick up the POST event just before the item is added.
In the second case where Ajax is being used via the Javascript wrapper API you can define a function which Shopify will call when the cart changes. E.g. suppose you defined this function:
Shopify.onCartUpdate = function(cart) {
alert('There are now ' + cart.item_count + ' items in the cart.');
};
The Ajax API will invoke it after items are added to the cart. You can check out the API sandbox to get a feel for it.
Finally there is the case where Ajax is being used directly. This the same scenario as this SO question and the accepted answer there where they work with the XMLHTTPRequest prototype methods look pretty good to me. If you are happy to use jQuery then using ajaxComplete would make it even simpler.