changed ajax native function to support older browsers