The world's oldest recorded joke has been traced back to 1900 BC and suggests that toilet humour was as popular with the ancients as it is today.
Full text of the joke is at the link above, along with a few others that date back 1000 years or so.
I was really surprised, I thought "horse walks into a bar and the bartender says 'why the long face?' would've shown up on the list somewhere....