Ajax class fro Javascript