Unable to figure out cd() command in console...

109 views
Skip to first unread message

madcap

unread,
Aug 18, 2008, 10:01:22 PM8/18/08
to Firebug
I'm trying to debug content within an iframe. Command-line queries, as
well as trying to search for items starting with particular IDs inside
the iframe fail, even though the DOM tree is navigable in the HTML
tab.

It seems I need to use the console function "cd(win)" to switch
firebug's focus to the content within the iframe. Yet, I cannot seem
figure out how to get this to work. I've tried passing the id of the
iframe as well as the result of $(idname). E.g. if "innerFrame" is the
ID (as well as the name, btw) of the iframe, both 'cd("innerFrame")'
as well 'cd($("innerFrame"))' don't complain about a bad argument or
anything, but they don't seem to change firebug's focus.

FWIW, I've also tried passing using 'cd("IDofInnerBody")' and 'cd($
("IDofInnerBody"))', where "IDofInnerBody" is just what it
describes... also to no avail.

Am I barking up the wrong tree here?

John J Barton

unread,
Aug 19, 2008, 12:43:30 AM8/19/08
to Firebug
If you are not using Firebug 1.2b13, start by loading it from
http://getfirebug.com/releases/firebug

madcap

unread,
Aug 18, 2008, 10:53:23 PM8/18/08
to Firebug
I forgot to mention, I'm using Firebug 1.2b13.

Peeyush Aggarwal

unread,
Oct 7, 2008, 12:36:34 AM10/7/08
to Firebug
use it like this cd(frames['idofFrame'])

John J Barton

unread,
Oct 7, 2008, 12:52:59 AM10/7/08
to Firebug
And wait for 1.3a4 or b1...http://code.google.com/p/fbug/issues/detail?
id=814

Jan Odvarko

unread,
Oct 7, 2008, 3:38:11 AM10/7/08
to Firebug
> use it like this cd(frames['idofFrame'])

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

2) If the <iframe> elemetn 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


Ellen

unread,
Nov 15, 2008, 11:58:27 AM11/15/08
to Firebug
As far as I can tell, the cd command simply does not work. For
example, given a frameset with 2 frames "data" and "myStage".

I've tried the following and ALL get a response of "null"
cd(frames[0]) and cd(frames[1])
cd(frames["1"])
cd(top)
cd(1) and cd(0)
cd("1") and cd("0")
cd(data) and cd(myStage)
cd("data") and cd("myStage")
cd(window.data)
cd(frames[0].contentWindow)

if, however, I simply type in frames[0], it returns "Window
page01.htm" and you can toggle the little triangle on the left to show
all properties of that window.
And if I type frames[0].pageNo it returns "1" which is correct.
So I guess until they fix cd, we can use frames[number].property as a
fallback.




Ellen
http://thedesignspace.net


On Oct 7, 2:38 am, Jan Odvarko <odva...@gmail.com> wrote:
> > use it like thiscd(frames['idofFrame'])

John J Barton

unread,
Nov 16, 2008, 11:23:22 AM11/16/08
to Firebug
I don't think they will fix 'cd' since no one has reported a bug with
it.
jjb

On Nov 15, 8:58 am, Ellen <elle...@gmail.com> wrote:
> As far as I can tell, the cd command simply does not work. For
> example, given a frameset with 2 frames "data" and "myStage".
>
> I've tried the following and ALL get a response of "null"
> cd(frames[0]) and cd(frames[1])
> cd(frames["1"])
> cd(top)
> cd(1) and  cd(0)
> cd("1") and cd("0")
> cd(data) and cd(myStage)
> cd("data") and cd("myStage")
> cd(window.data)
> cd(frames[0].contentWindow)
>
> if, however, I simply type in frames[0], it returns "Window
> page01.htm" and you can toggle the little triangle on the left to show
> all properties of that window.
> And if I type frames[0].pageNo it returns "1" which is correct.
> So I guess until they fix cd, we can use frames[number].property as a
> fallback.
>
> Ellenhttp://thedesignspace.net
Reply all
Reply to author
Forward
0 new messages