[Project_owners] Getting the panel (tab) id for tabs out of focus

Philip Chee philip.chee at gmail.com
Mon Jun 2 05:21:45 PDT 2008


On Fri, 30 May 2008 21:15:25 +0200, Jesper Staun Hansen wrote:

> http://lxr.mozilla.org/mozilla/source/xpfe/global/resources/content/bindings/tabbrowser.xml#926)
> 925             var tabBrowser = this.parentNode.parentNode.parentNode;
> 926             var tab = 
> document.getAnonymousElementByAttribute(tabBrowser, "linkedpanel", this.id);

This "this" refers to one of the anonymous browser elements within the
tabbrowser.

> 331              var tabBrowser = 
> getBrowser().parentNode.parentNode.parentNode.parentNode;
> 332              var tab =
document.getAnonymousElementByAttribute(tabBrowser, "linkedpanel", this.id);

Where is this bit of code running? And what does the "this" in "this.id"
refer to?

Um, you realize of course that the "this" object isn't fixed and is
always relative to the context of where your code is currently running,
don't you?

Phil

-- 
-==-
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Computers ARE the future. Oh the future looks grim!
* TagZilla 0.066.6



More information about the Project_owners mailing list