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

Can't reference my sidebar

0 views
Skip to first unread message

S.Hamel

unread,
Nov 5, 2006, 8:23:43 PM11/5/06
to
I have created a Firefox sidebar extension that display correctly, but
I can't get my JavaScript to reference the objects in it to make
updates to the content.

The XUL looks like this:
<page id="asidebar" orient="vertical" title="&waspSidebar.title;"

xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
style="overflow:hidden">
<vbox id="avbox" flex="1">
<label id="alabel" value="initial label" />
</vbox>
</page>

I'm trying to reference the label using
document.getElementById("alabel").value but I keep getting
"document.getElementById("atest") has no properties".

Tx

mark bokil

unread,
Nov 5, 2006, 10:05:13 PM11/5/06
to dev-ext...@lists.mozilla.org

> reference the label using
> document.getElementById("alabel").value but I keep getting
> "document.getElementById("atest") has no properties".
>
>
My first thought is that you are getting the current page document but
the sidebar is not the current document so you will get back a null
object. You need to reference the document object of your sidebar page
otherwise your Id in your sidebar will not be found. Two separate
documents. You are referencing the current page document but not the
sidebar's.

gmgj

unread,
Nov 17, 2006, 4:56:08 PM11/17/06
to
Can you post where atest is coming from?
I do not see an ID for it in your example?

S.Hamel

unread,
Nov 17, 2006, 8:27:36 PM11/17/06
to
Sorry, that should read "avbox" and "alabel".
I read the answer from Mark, which is probably the problem. But this
doesn't tell me how to solve my problem ;)
0 new messages