Difference between revisions of "Cd"

From FirebugWiki
Jump to: navigation, search
(Added description of syntax, hint for needing help and linked back to Command Line API)
m (Added categories)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{needsHelp}}
+
By default, command line expressions are relative to the top-level window of the page. This command allows you to use the window of a frame in the page instead. So all expressions will be executed within the context of that frame from then on.
 
+
By default, command line expressions are relative to the top-level window of the page. This command allows you to use the window of a frame in the page instead.
+
  
 
== Syntax ==
 
== Syntax ==
Line 7: Line 5:
 
cd(window)
 
cd(window)
 
</source>
 
</source>
 +
 +
== Parameters ==
 +
=== window ===
 +
Frame window to switch to. '''(required)'''
 +
 +
== Examples ==
 +
<source lang="javascript">
 +
cd(document.getElementById("someframe").contentWindow)
 +
</source>
 +
 +
Changes to the <code>window</code> of the <code>&lt;frame&gt;</code> with the id <code>someframe</code>.
 +
 +
<source lang="javascript">
 +
cd($$("iframe")[0].contentWindow)
 +
</source>
 +
 +
Changes to the <code>window</code> of the first <code>&lt;iframe&gt;</code> using the [[$$|$$ command]].
  
 
== See also ==
 
== See also ==
 
* [[Command Line API]]
 
* [[Command Line API]]
 +
 +
[[Category:Firebug]]
 +
[[Category:UI]]
 +
[[Category:API]]

Latest revision as of 17:03, 21 November 2013

By default, command line expressions are relative to the top-level window of the page. This command allows you to use the window of a frame in the page instead. So all expressions will be executed within the context of that frame from then on.

Syntax[edit]

cd(window)

Parameters[edit]

window[edit]

Frame window to switch to. (required)

Examples[edit]

cd(document.getElementById("someframe").contentWindow)

Changes to the window of the <frame> with the id someframe.

cd($$("iframe")[0].contentWindow)

Changes to the window of the first <iframe> using the $$ command.

See also[edit]