Adding javascript to the right location.