Would you believe that this has been going on for over three-thousand five hundred years?
That's when the oldest recorded gag joke was put down on a clay tablet in Mesopotamia. Here's one of three ancient old knee-slappers orientalists have pulled from the sands of Iraq:
In(?) your mouth and your teeth (or: your urine)
constantly stared at you
the measuring vessel of your lord. (— What is it?)
The same tablet contains what is most likely the earliest Yo Mama joke, though only the middle of the joke remains, so it's of minor interest.
The collection of translations in the journal Iraq from which these jokes are taken also presents a dialogue between two friends (too fragmentary to be interesting to the non-expert) and a very promising set-up where a barber of evil, a harlot of evil, a scribe of evil and one unidentified professional woman (of evil?) argue with their clients. I smell an Adult Swim series.
If you want antiquity to give you jokes that make sense, you have to jump forward about a millennium and a half to Rome. The historian Mary Beard found an old Roman joke book that contains jokes that are actually amusing. Two favorites jump out at me.
A barber, a bald man, and a bumbling man are taking a trip. One night they have to sleep outside and they take turns looking after the luggage. The barber gets bored during his watch so he shaves the bumbling man's head. When the bumbling man is roused for his watch, he feels his head and thinks. 'Stupid barber. He's woken the bald man instead of me.'
An absent-minded professor is asked to bring his friend two fifteen year old slaves. He says, sure. But if I can't find two fifteen year olds, will one thirty year old do?
Now that is comedy. People have been laughing at absent-minded professors since Caesar.