Hamlet presents a complex textual situation. It exists in three versions, with the first quarto (1603) very different from and markedly shorter than the second quarto (1604–5) and Folio (1623) versions. It is also very hard to date because, besides the probability that Shakespeare revised his own work, there are references indicating that a play on this subject, now referred to as the Ur-Hamlet and no longer extant, pre-existed Shakespeare's play. I here follow Q2, noting textual variation where it is important to the discussion. No play illustrates Shakespeare's characteristically mixed dramaturgy or his dialogue with the popular theatre of his immediate predecessors better than Hamlet, which creates a hero with an ethical dilemma, like Brutus, and puts him in dialogue with the popular form of revenge tragedy.
The Chamberlain's Men, who performed Hamlet at the Globe, probably in 1600–1, were one of two companies who had dominated the London theatre scene since 1594. Theatre had by this time become truly embedded in London life, and the companies could make references to their previous plays or to the other company's plays in the expectation that audiences would understand the in-jokes and appreciate the flattery of being positioned so knowingly. Thus when Polonius tells Hamlet ‘I did enact Julius Caesar. I was killed i' th' Capitol. Brutus killed me' (3.2.99–100), it is likely that the same actors who played Caesar and Brutus in Julius Caesar were again playing opposite each other here as Polonius and Hamlet. There is even a long and highly topical passage, existing only in the Folio text, where Hamlet inveighs against the child actors who ‘are now the fashion’ and widely applauded (2.2.335–60). Confident, witty and innovative in the face of competition, Shakespeare and the Chamberlain's Men address a regular audience in Hamlet through a mixture of clowning and seriousness. Here the tragic hero is not separate from the clowns but rather separate to a degree from the court and capable himself of clowning and acting a role as well as of unpacking his heart.