The ultraviolet continua of the nuclei of M31 and M81