Ajax calling in a function goes into abspath loop

Ajax calling in a function goes into abspath loop