Moves js to the appropriate place