The onClick event is captured properly when embedded in the tag <img src="blank.jpg" onClick="alert('embedded click')"> or when using the addEventListener("click",functionName,false), but not with the simple document.getElementById(idOfImage).onclick = addHandler;
I can reproduce this bug on PowerMac G3 with 160 MB RAM running Mac OS 8.6. Mozilla Build 20000053108. The test page works correctly on Explorer 5 Mac but not in Navigator 4.7.3 nor in Mozilla.
Is this in any DOM spec (I can't find it), or is it just a bug for IE5-parity?
I would think this would fall under DOM Level 0 or the Netscape 3 event model, which was never implemented for most elements. This behavior is supported in M15 for virtually every element in a document except img. If this is something worth fixing which I think it is, I guess a better testcase is needed to see which elements support this and which do not.
Joki, I played around with this a bit and it looks like we really don't handle dynamically setting img.onclick, could you have a look?
Assignee: jst → joki
Status: UNCONFIRMED → NEW
Ever confirmed: true
Fix in hand. Attaching diff, not sure when this will get approval for checkin.
Status: NEW → ASSIGNED
Whiteboard: fix in hand, diff attached.
*** Bug 42693 has been marked as a duplicate of this bug. ***
Sorry, typo in the bug number. bug 42693 is not a duplicate of this bug.
Adding [fixinhand] to allow easier sorting while waiting for nsbeta3 tree checkins. Nominating nsbeta3.
Keywords: testcase → nsbeta3
Whiteboard: fix in hand, diff attached. → [fixinhand]
Whiteboard: [fixinhand] → [fixinhand][nsbeta3+]
Joki's fixes have been checked in by saari. Marking fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Nisheeth, Some how I'm not able to see the alert. I guess it is still there. I tried it with Win-95 too, but it does not work. Reopening right now, if you think it is fixed please let me know like that.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Well the test case seems to not have an image with it. If you try this test case with a valid image it works just fine. I don't know that we are trying to support events over broken images.
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago → 18 years ago
Resolution: --- → FIXED
Verified fixed on NT build around 2000-09-25.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.