The design of the flushing toilet was likely by Sir John Harrington (also Harington, 1561-1612) in 1596.
Toilets were in use before written history in the Indus Valley region (now India-Pakistan), dating to as early as 2600 BC.
Little is known of the inventor J. F. Brondel who developed a valve-type flushing mechanism in 1738. However, the modern version of the toilet is mostly unchanged since the patenting of the S-trap by Alexander Cummings in 1775.
The dispute continues to the present over the role of Thomas Crapper (1836-1910), who holds patents on several features of modern toilets, including the floating ballcock. The application of the slang name to the toilet actually precedes Crapper, being derived from the Dutch or Old French crappe, meaning chaff).
Thomas Crapper did not invent the toilet, though he did invent the ballcock, and he is credited with widely popularising the use of toilets, particularly as indoor facilities. He was a plumber and (later) manufacturer who incorporated/adapted a number of established designs and inventions into his toilets, yet he is often erroneously credited as the inventor of the toilet itself (which, as mentioned, is at least several thousand years older than him).
The word 'crap' (used as a curse, in reference to something shoddy, or as a direct reference to the act/product of bowel movement) is very old- much older, in fact, than Thomas Crapper himself. His name is seen as (an appropriate) coincidence.
The basic components of a modern (western) toilet include Albert Giblin's syphoning cistern, Sir John Harrington's flushing system, Alexander Cummings' S-trap or U-bend, and Thomas Twyford's characteristic all-ceramic bowl/cistern. Thomas Crapper put all this together into what we call nowadays... a crapper!