The default bug view has changed. See this FAQ.

xul oncommand attribute isn't parsed when accessed through DOM

NEW
Unassigned

Status

()

Core
DOM: Events
13 years ago
7 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

(Blocks: 2 bugs, {testcase})

Trunk
x86
Windows XP
testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
In bug 246719, I'm trying to make middle-clicking on more elements work, using
code like:
   oncommand="var url = ...; openUILink(url, event);"
   onclick="if(event.button==1) this.oncommand(event);"

If I middle-click an element with this before left-clicking it, I get
"this.oncommand is not a function" and openUILink is not called.  If I
left-click first, it works fine when I middle-click.
(Reporter)

Comment 1

13 years ago
Workaround: use eval.  eval(this.getAttribute('oncommand'))

I don't like this workaround because using eval in chrome JS can be dangerous,
and because it's more code than this.oncommand(event).
(Reporter)

Updated

13 years ago
No longer blocks: 246719
(Reporter)

Comment 2

13 years ago
bugzilla-mozilla@dorando.at had the same problem in bug 230401.  Once this is
fixed, the code from bug 230401 and bug 246719 should be changed to not use eval().

Comment 3

12 years ago
*** Bug 284250 has been marked as a duplicate of this bug. ***
(Reporter)

Updated

11 years ago
Blocks: 88314

Comment 4

11 years ago
Note that we do have a .doCommand but it doesn't take an existing event.

Updated

9 years ago
Blocks: 461376

Updated

9 years ago
Blocks: 461578
Assignee: events → nobody
QA Contact: ian → events
You need to log in before you can comment on or make changes to this bug.