inititalise ajax in head