Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with sidebar and context menu

19 views
Skip to first unread message

Pengyu Hong

unread,
Nov 26, 2006, 12:16:21 AM11/26/06
to
I developed a sidebar and added a menu item to the Firefox context menu
(contextAreaContextMenu). Both the sidebar and the menu are displayed OK.
What I want is to change some elements in the sidebar when that context menu
item is clicked. However, the codes invoked by the context menu item cannot
access any XUL emlement in the sidebar using document.getElementById( id ).
Does anyone have any ideas? Thank you very much.

Pengyu


Nickolay Ponomarev

unread,
Nov 26, 2006, 9:44:04 AM11/26/06
to Pengyu Hong, dev-te...@lists.mozilla.org
The sidebar's content is a separate document, so you should use
document.getElementById("sidebar").contentDocument.getElementById( ...
)

This is something you could see using the DOMi.

See also http://developer.mozilla.org/en/docs/Working_with_windows_in_chrome_code

Nickolay

P.S. Please if you absolutely have to bump your thread, do so by
posting a newer message with new information in it, instead of
starting a whole new thread.

0 new messages