run code on any click event

run code on any click event

Hi all,

I am not sure how to ask this question without confusing somebody, but I will try my best.

I have a few buttons on a page, and form fields. Obviously I have click events for the buttons, and I also have a click event for the form inputs. These run different things of course.

Now is there a way to call a function when any of these events take place, without having to add a function call in each click event. Like a global function that runs when any jquery call is made. Because I have many pages with buttons it would be a pain to have to add a function call to every click event.

Here is the reason I am asking.
Whenever a buttons is clicked, or text entered into input I want to check if the session is still active and redirect the page if it is not. Now I can put this code into a function, but I would like this function to run whenever there is a jquery call or any button is pressed.

Any ideas would be great.

regards
Thomas