The legend of Salomé has its beginnings in the Gospels of Matthew and Mark (Matthew 14: 3–11, Mark 6: 17–28). Herod, the Tetrach of Judaea, beheads John the Baptist at the instigation of Herodias, wife of Herod, who was angered by John's charge that her marriage was incestuous. In both accounts, Herodias uses her daughter (unnamed in scripture but known to tradition, through Josephus, as Salomé) to exact the prophet's execution. According to the Gospel of Mark: [W]hen a convenient day was come Herod on his birthday made a supper to his lords, high captains and chief estates of Galilee. And when the daughter of the said Herodias came in, and danced, and pleased Herod and them that sat with him, the king said unto the damsel, "Ask of me whatsoever thou wilt, and I will give it thee." And he sware unto her, "Whatsoever thou shalt ask of me, I will give it thee, unto half of my kingdom." And she went forth and said unto her mother, "What shall I ask?" And she said, "The head of John the Baptist." And she came in straightway with haste unto the king, and asked, saying, "I will that thou give me by and by in a charger the head of John the Baptist" And the king was exceeding sorry; yet for his oath's sake and for their sakes that sat with him, he would not reject her. And immediately the king sent an executioner, and commanded his head to be brought, and he went and beheaded him in prison. And brought his head in a charger, and gave it to the damsel; and the damsel gave to her mother. (6: 21–28, King James Bible)
Here, the guilt for John's execution rests with Herodias, and such was the prevailing belief until the Baptist became a more widely venerated saint. John's veneration brought with it the increasing denigration of Salomé. The Salomé legend was a prominent one in both literature and the visual arts until the end of the Renaissance and then again with revival in the nineteenth century, the era of Europe's colonial expansion into the Orient. In particular Heinrich Heine's Atta Troll (1843) served to inspire an entire series of Orientalist explorations by such divergent authors as Flaubert, Mallarmé, Huysmans, and Maeterlinck. In his epic, Heine invents a fantastic setting for the story: during the vision of a witch's wild chase, the narrator describes how Herodias, laughing madly with desire, kisses the head of John. She had loved him, Heine continues, and had demanded his head in the heat of passion—for, he asks, "why would a woman want the head of any man she did not love?" The epic thus becomes one of the first adaptations of the legend to attribute explicitly John's decapitation to feminine desire: the necrophilic kiss figures as Herodias' punishment.
Wilde's literary background ensures that he was aware of, if not intimately acquainted with, the large majority of Salomé treatments, and he made obvious reference to some of them in his 1892 drama. He was certainly familiar with the novels of Gustave Flaubert, most particularly with the short story "Hérodias," which had appeared in Trois Contes (1877). As Robert Schweik has noted, however, Flaubert's setting of the Salomé legend, however, bears only a superficial resemblance to Wilde's own, depending largely on the carefully researched and minutely realistic social detail typical of Flaubert's fiction. Many critics have argued that far more influential for Salomé's genesis of Wilde's were the paintings of Gustave Moreau, whose strange and mystical themes laid the groundwork for later expressionist painting as well as for the poetry and art of the Decadents. In particular, Moreau's Salomé Dancing Before Herod (1876) played a vital role for Salomé's interpreters. Moreau's setting of Salomé's dance does not merely recreate the biblical legend but abstracts her—in high Orientalist fashion—from biblical tradition and sets her in the theogonies of the Orient, placing in her hand a lotus blossom, the scepter of Isis, and the sacred flower of Egypt and India, a phallic emblem or the token of a sacrifice of virginity. Denied any precise indications of race, faith, nation, or epoch, Salomé comes to rest in the French museum as a symbol of the Orient served up for the Western viewer's consumption.
The most famous literary encounter with Moreau's Salomé is undoutedly that of Joris Karl Huysmans. A Dutchman writing in French, Huysmans gives a prominent description of the Salomé painting, as well as its effect on the viewer, in his decadent and influential novel A Rebours (1884). The novel's protagonist, des Esseintes, has acquired Moreau's painting, considering it to incarnate the very spirit of decadence: it is one of the few works of art which send him into raptures of delight. Huysmans's anthropological musings were well-known to Wilde, although they are relegated to near insignificance in his play. Wilde's love for Huysmans's novel was surpassed perhaps only by his admiration for the reigning French Symbolist poet, Stephane Mallarmé. Although his writings are few in number, Mallarmé was a driving force for the Symbolist movement throughout the 1890s, providing both a model for other poets and a springboard for new ideas, many of them formulated at one of the salons or café meetings that he organized in Paris. Mallarmé's theories of poetics and literature were to shape Wilde's outlook, as well, and it is thus no surprise to find that his Hérodiade (1869), a lyrical drama telling the tale of Herodias' marriage to Herod, echoes strongly with Wilde's drama.
It is important to note, however, that whereas Mallarmé's Hérodiade is a frigid princess who aims to "triumph over all her longings," Wilde's Salomé lusts fiercely. Moreover, in Wilde's play the figures of Salomé and Herodias are distinct; in many legends, by contrast, there was confusion as to the role of each woman. In most cases, Salomé had played a rather minor part usually as a young girl, subservient to the wishes of her mother, who became a pawn in the machinations between Herodias and Herod. Under Wilde's pen, however, Salomé stands forth. Herodias, on the other hand, long the heroine of legend, loses her erotic attachment to John and gains in jealousy, anger, and stolid practicality: she is the antithesis of symbolic mysticism, placed in direct opposition to Herod and Salomé.
Another important Symbolist author to Salomé's genesis was Maurice Maeterlinck, one of the first Symbolists to produce and theorize drama as well as poetry. Maeterlinck's dramas, known more for their style than for their plots, emphasized a universal "mystery" and a sense of impending doom, as well as an awareness of the transitory nature of reality and existence. In accordance with this deliberate mysticism, the language of his plays almost forms its own idiom. His characters speak with the mechanical precision of marionettes: childish, simplistic, absurd. A number of critics, defending what some have read as the play's childish prattle, have emphasized the possible similarities between Wilde and Maeterlinck's use of language.