I'm trying to add an event handler for to my body, and for some reason which I can't figure out, it only works on Google Chrome. I wouldn't expect it to work in IE, but am wondering why it's not working in Firefox.
Here's the relevant parts of the code:
Javascript (in an external file)
Code:var body = document.body;
body.addEventListener("load", Foo(), false);
function Foo(){
addEventListener(document.getElementsByName("start"),"click", alert("hello"), false);
}
HTML
Code:
<html>
<head>
<title>BREAKOUT!</title>
<script src="breakout.js" type="text/Javascript" >
</script>
<LINK REL="stylesheet" HREF="breakout.css" TYPE="text/css">
</head>
<body id="body">
<!-- etc.... -->