Despite common belief, nobody threw their stuff out the window. quite the opposite in fact it is known that most major cities had a law against it and almost all village/ town/ etc. wouldn't allow it.

Toilets most commonly came in Three Forms:
Public Bathhouse: For the Lower and most of the middle class, A Public Bathhouse was one of the centralized plumbing fixtures, now yes people did have chamber pots which was commonly mixed with the closest thing to trash then (apple cores, rotten leather, etc.) and then they took to the Bathhouse to empty. Those for the middle class were in much better conditions.

Bathrooms: Yes a LOT of people actually had bathrooms, in richer districts the people would have essentially brick seats with holes in them, the hole would lead to a lead or clay pipe which connected to the municipal plumbing system like the romans.

Composting Outhouse: almost all rural folk had composting Outhouse's, which could be emptied and the Humanure used as fertalizer.

And theres your scatological history lesson for today.