events set with javascript don't work when the element has no event attributes

VERIFIED WORKSFORME

Status

()

Core
DOM: Events
P2
normal
VERIFIED WORKSFORME
17 years ago
4 years ago

People

(Reporter: Sjoerd Visscher, Assigned: joki (gone))

Tracking

Trunk
mozilla0.9.3
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0; COM+ 1.0.2204)
BuildID:    2001051104

When I set an onclick handler like

element.onclick=new Function('','alert("onclick works")')

it only works when the element already has an event attribute set in the HTML 
source. I guess there is an optimization that checks if an element is dynamic 
or not???

Reproducible: Always
Steps to Reproduce:
see attachment
click on each sentence

Actual Results:  only 2 of 4 sentences fire the onclick event

Expected Results:  all sentences should fire the onclick event, when clicked
(Reporter)

Comment 1

17 years ago
Created attachment 34237 [details]
each line should fire the onclick event
(Reporter)

Updated

17 years ago
Summary: events set with javascript don´t work when no event attributes → events set with javascript don't work when the element has no event attributes
(Assignee)

Updated

17 years ago
Target Milestone: --- → mozilla0.9.2

Comment 2

17 years ago
Also happens on Windows 98 and RedHat Linux
OS: Windows 2000 → All
Hardware: PC → All
(Assignee)

Updated

17 years ago
Priority: -- → P2
(Reporter)

Comment 3

17 years ago
It works again for me with windows build 2001060604
All lines fire the onclick again.

Can somebody verify?
(Assignee)

Comment 4

17 years ago
Moving lower priority bugs out of .9.2 milestone.
Target Milestone: mozilla0.9.2 → mozilla0.9.3

Comment 5

17 years ago
works for me on build 2001071903 win32

Comment 6

17 years ago
Marking WFM (it worksforme also).
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → WORKSFORME

Comment 7

17 years ago
Yep, works now. Verifying.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.