Closed Bug 401060 Opened 17 years ago Closed 17 years ago

Event object in javascript is not working

Categories

(Firefox :: General, defect)

x86
Other
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: amoghkutumbe, Unassigned)

Details

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Build Identifier: windows 2003 R2 SP2

In my application there is a table with check all button.When this button is clicked then all the check boxes below are checked.In the function handleOnClick i have written following line
"if (!eventObj || typeof eventObj.keyCode !== typeof 1) { eventObj = event; }"
In mozilla/firefox it is throwing a javascript error saying "event is not defined" the same is supported by IE.
Please anybody having its solution to replace this event object?

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Actual Results:  
Javascript error coming

Expected Results:  
javascript error should not occur
Look for articles, tutorials on the DOM 2 event method addEventListener, like:
Working With Events in Netscape 6
http://www.scottandrew.com/weblog/articles/events

event is a global variable in MSIE; not so in Mozilla-based browsers and those following DOM 2 events interface

Amogh, you posted only 1 line of code; no URL. So it's impossible to guide you any further.

Making your web page compatible with Firefox
http://www.reloco.com.ar/mozilla/compat.html

DOM:element.addEventListener
http://developer.mozilla.org/en/docs/DOM:element.addEventListener

For support on web authoring, I highly recommend that you first consult these:
1-
Using Web Standards in your Web Pages
http://developer.mozilla.org/en/docs/Using_Web_Standards_in_your_Web_Pages

2-
Mozilla Web Author FAQ
http://www.mozilla.org/docs/web-developer/faq.html

and then for coding assistance
3- MozillaZine Forum: web development and standards
http://forums.mozillazine.org/viewforum.php?f=25

Resolving as WORKSFORME
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.