Timing is important. If you're going to tell that joke about the dwarf and the cucumber, don't do it when you're having lunch with his mother. You've got to find the joke funny yourself but not to the point of incontinence. The idea is to make other people laugh until they wet themselves, not to have you purple and shrieking with wee trickling down your leg in the middle of a joke, while your audience is left wondering what's going on. Keep it short and don't attempt accents unless you are with the Radio 4 Drama Rep Company. As to content, I think anything around the gusset area and words like "poo-poo" are terribly funny, but that's just me. At the end of the joke, you are allowed a smug titter - as long as everyone else is laughing.
Comedienne Jenny Eclair is starting a new UK tour