Last Comment Bug 246720 - xul oncommand attribute isn't parsed when accessed through DOM
: xul oncommand attribute isn't parsed when accessed through DOM
Status: NEW
: testcase
Product: Core
Classification: Components
Component: DOM: Events (show other bugs)
: Trunk
: x86 Windows XP
-- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Andrew Overholt [:overholt]
Depends on:
Blocks: 88314 461578 461376
  Show dependency treegraph
Reported: 2004-06-14 17:02 PDT by Jesse Ruderman
Modified: 2010-10-27 20:55 PDT (History)
8 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Jesse Ruderman 2004-06-14 17:02:42 PDT
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.
Comment 1 User image Jesse Ruderman 2004-06-15 15:33:31 PDT
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).
Comment 2 User image Jesse Ruderman 2004-06-18 23:25:10 PDT 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 User image Stephen Lee 2005-03-02 01:46:10 PST
*** Bug 284250 has been marked as a duplicate of this bug. ***
Comment 4 User image 2006-07-12 01:46:42 PDT
Note that we do have a .doCommand but it doesn't take an existing event.

Note You need to log in before you can comment on or make changes to this bug.