finding elements buried in a frameset

5 views
Skip to first unread message

Robert Mark Bram

unread,
Oct 2, 2008, 4:25:04 AM10/2/08
to Firebug
Hi All,

I have a frameset and am using Firefox 3 with Firebug 1.2.

I have an element with a given id, "xxx".

When I just press F12 and enter into the console $('xxx') it doesn't
find the element i.e. prints null.

If I right click > This Frame > Show only this Frame and repeat the
action above, it finds the element.

How do I address the element from the main window?

Rob
:)

Jan Odvarko

unread,
Oct 2, 2008, 10:40:26 AM10/2/08
to Firebug
This is a bug:
http://code.google.com/p/fbug/issues/detail?id=814

It should be possible to change the window context using a cd
function, which is available in the Firebug's command line.

Honza

Robert Mark Bram

unread,
Nov 3, 2008, 5:42:09 PM11/3/08
to Firebug
Hi Jan,

On Oct 3, 1:40 am, Jan Odvarko <odva...@gmail.com> wrote:
> This is a bug:http://code.google.com/p/fbug/issues/detail?id=814
>
> It should be possible to change the window context using a cd
> function, which is available in the Firebug's command line.

Do you just issue the command as "cd ('frame-name')" ? And can you use
"top" etc?

I have experimented a bit with this, but haven't yet gotten it to do
what I want.

Rob
:)

Jan Odvarko

unread,
Nov 4, 2008, 2:37:54 AM11/4/08
to Firebug
> Do you just issue the command as "cd ('frame-name')" ? And can you use
> "top" etc?
Yes, there is a few possibilities:

1) If the <iframe> element has a name attribute you can use it
directly.
<iframe name="frameName" ... />
cd(frameName);

2) If the <iframe> element has an ID you can also use it.
<iframe id="frameId" ... />
cd($("frameId").contentWindow);

3) To change the context to the top window again use:
cd(top)


Honza

Reply all
Reply to author
Forward
0 new messages