handle the ajax of the function: following events