Firebug控制台中的多行无法正常工作 [英] Firebug multiple lines in console not working properly

查看:96
本文介绍了Firebug控制台中的多行无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firebug不会在控制台中显示所有行。如果我的代码看起来像这样:

Firebug doesn't show all lines in console. If my code looks like this:

var  arr=[4,3,2];

console.log("console");
arr; 

结果分为两行,应为:

console
[4, 3, 2]

但是当顺序不同时,最后仅显示一行:

but when it's a different order, only one line is shown at the end:

arr;
console.log("console");

结果:

console

问题随一切出现,只有使用控制台,您才能收到其他输出如果将其放在数组/对象/函数调用之前,则在第一行,否则将跳过其他输出。
是否有一种方法可以使Firebug在控制台中产生input => output结果,而无需实际跳过任何内容?

Problem appears with everything, and only using console, you can receive additional output line if it's put before array/object/function invokation, otherwise other outputs are skipped. Is there a way to make firebug produce input=>output result in console without actually skipping anything ?? If it's not possible, is there a different tool(with js compiler) that could do that ??

推荐答案

Firebug和其他浏览器开发人员工具输出评估脚本的返回值。因为只能有一个返回值,所以只能得到一个输出。

Firebug and other browser developer tools output the return value of the evaluated script. Because there can only be one return value, you only get one output.

如果要获得更多输出,则需要使用控制台API 方法,例如 console.log()

If you want to get more outputs, you need to use the Console API methods like console.log().

您可能要使用JavaScript调试器,而不是使用控制台来调试代码。在Firebug中,调试器可在 脚本面板中使用。 br />
这使您可以在某一行停止脚本执行,并在代码的特定位置查看所有变量的值。

Instead of using the console for debugging your code, you may want to use the JavaScript debugger instead. In Firebug the debugger is available within the Script panel.
This allows you to stop the script execution at some line and see the values of all variables at that specific point of your code.

这篇关于Firebug控制台中的多行无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆