Today I've spent quite some time chasing a bug in a legacy code at work. In retrospect, the problem is trivially simple.

It can be illustrated by the following snippet.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body>
<script src="irrelevant.js" type="text/javascript"/>
<script type="text/javascript">
function meow() { alert("meow"); }
</script>
<a href="http://dailyotter.org/"
 onclick="meow(); return false;">
click for meow</a>
</body>

So, why does it show you otters instead of meowing, and how long did it take you to spot the bug?

I don't know if this is a riddle or execise, so I will answer it in Rot13:

Vg vf orpnhfr gur svefg fpevcg gnt zhfg or rkcyvpvgyl pybfrq jvgu n erny raq gnt.

Comment by Thomas Thu May 10 16:46:20 2012