Bill Brown bio photo

Bill Brown

A complicated man.

Twitter Github

Over at Found on the Web, I've made my first April Fool's joke. As you might expect, it's Rick-Roll related.

Here's the Javascript I used:


<script type="text/javascript" language="javascript">
var links = document.getElementsByTagName("a");
for (var i=0; i < links.length; i++)
{
links[i].onclick = function()
{
location.href="http://www.youtube.com/watch?v=oHg5SJYRHA0";return false;
};
}
</script>

It gets every hyperlink on the page, loops over them, and adds an onclick event handler that performs the redirect.