finished javascript loading logic