开发者

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开发者_StackOverflow that it's increasing.


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜