Event handler to cache clicks and send function to post by ajax