sandraqu
sandraqu

Reputation: 1528

how do i use firebug or chrome console instead of alert() to see variable values?

how do i use firebug or chrome console instead of alert() to see variable values?

currently, I want to see the value of var i as it increases. Not sure that it's increasing.

Upvotes: 0

Views: 1150

Answers (3)

sguy
sguy

Reputation: 108

You probably want to use console.log(). It just prints the parameters in the firebug console. More info can be found on http://getfirebug.com/logging.

Upvotes: 1

evil otto
evil otto

Reputation: 10582

You could use something like the YUI Logger control - http://developer.yahoo.com/yui/logger/ - which puts a log window on your webpage that you can write debugging messages to and clear/hide/etc.

Or you could try a javascript shell bookmarklet that opens a separate shell in the context of the main window. One example is available at https://www.squarefree.com/bookmarklets/webdevel.html, and there may be others.

Upvotes: 0

red
red

Reputation: 3233

You can use a breakpoint on this variable. You can find explanations for the Chrome Inspector here: http://code.google.com/chrome/devtools/docs/scripts-breakpoints.html

Upvotes: 1

Related Questions