norsewulf
norsewulf

Reputation: 511

How do I write directly into the console?

I read an answer to a question on SO and someone suggested writing directly into the console. I thought, that sounds cool let's give it a go. I proceeded to make an attempt, but I couldn't figure it out. How do I write/run code directly in the console? I tried in Firebug & Firefox's inspector and I did a little Google search as well. Did I misunderstand something?

Upvotes: 0

Views: 1096

Answers (2)

Sebastian Zartner
Sebastian Zartner

Reputation: 20095

Firebug has two ways to execute some code (and write to the console). These are the Command Line at the bottom of the Console panel:

Firebug Command Line

and the Command Editor if you want to write some larger scripts:

Firebug Command Editor

which is available by clicking the little arrow at the right side of the Console panel:

Command Editor toggle button

The Firefox DevTools have a similar feature to the Command Editor of Firebug called Scratchpad:

enter image description here

This tool is available via the Firefox menu > Developer > Scratchpad or by pressing Shift+F4.

Upvotes: 1

evilpie
evilpie

Reputation: 2941

MDN has some example about Outputting text to the console.

The most simple example is: console.log("Hello World!"); Which should show up in the Firefox Console. (There might be some issue if you use Firebug at the same time)

Upvotes: 0

Related Questions