simple javascript function to display error / success messages after AJAX events