The legalization of online sales of nonprescription drugs has given rise to 306 violations in about 24 hours, the government said Friday.