Implements the "Ajax" function.