Reply Wed 26 Oct, 2011 08:35 pm
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);

<script src="breakout.js" type="text/Javascript" >
<LINK REL="stylesheet" HREF="breakout.css" TYPE="text/css">

<body id="body">
<!-- etc.... -->
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 1,069 • Replies: 0
No top replies


Related Topics

In How much time a website can be developed? - Question by aussiejumpingcastle
Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
  1. Forums
  2. » addEventListener issue
Copyright © 2020 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 09/27/2020 at 08:16:26