<script> —

Swedish voter uses JavaScript code as write-in candidate

Injecting a bit of code through paper ballots.

Swedish voter uses JavaScript code as write-in candidate

Swedish democracy had its latest workout last Sunday, September 14, with the election of members to the national parliament (Riksdag), county council assemblies, and municipal assemblies. While established political parties drew most of the votes, Sweden allows (and then minutely chronicles) write-in votes. This process has created such venerable institutions as the Kalle Anka Partiet (the "Donald Duck Party," a common write-in), but it also lends itself to more mischievous uses—such as jotting down a bit of JavaScript on the vote form.

Valmyndigheten, the Swedish electoral authority, helpfully logs every single write-in vote across the country, then publishes the complete list on its website. In last Sunday's election, for instance, Swedes voted for:

  • Satanistiskt initiativ
  • Schizofrena autistpartiet
  • Wisemans wisdoms
  • Young volcanoes
  • Vote for pedro
  • Jesus kristus! vår frälsare som älskare oss, dog för oss vill oss det absolut bästa! Halleluja ("Jesus Christ ! Our savior loves us, died for us, wants the best for us! Hallelujah")
  • Ett bättre Sverige för Allah ("A better Sweden for Allah")
  • Bangkok bargirls
  • Led Zeppelin

And, naturally, the "Cannabispartiet."

Buried among all the jokes and fringe parties was this line, which an Ars reader pointed out to us:

"script"alert('l')"/script"

Which was some election monitor's attempt at transcribing this:

<script>alert('l')</script>

Which is, of course, a bit of JavaScript for popping up an alert box containing only the letter "l". The hope was apparently that Valmyndigheten would simply publish the unsanitized code on its website, popping up a box for every visitor to the page. (Either that or the voter believed an alert box could do a better job of representing Sweden than human politicians.) Clever—but unsuccessful.

Note to Swedes for future elections: "Ars Technica" would make a terrific write-in candidate—even if it doesn't appear in an alert box.

Channel Ars Technica