简体   繁体   English

使用console.log()调试ExtJS 4

[英]Debugging ExtJS 4 using console.log()

I am very new to ExtJS and still going through the Docs in Sencha site. 我是ExtJS的新手,仍然在Sencha网站上浏览文档。 I've seen a lot of examples in ExtJS4 using console.log() for debugging. 我已经在ExtJS4中看到了许多使用console.log()进行调试的示例 However I couldn't figure out how to deal with console.log(). 但是我不知道如何处理console.log()。

I am using Aptana Studio 3 for development, and I don't think Aptana can run console.log() (correct me if im wrong). 我正在使用Aptana Studio 3进行开发,但我不认为Aptana可以运行console.log()(如果我输入错误,请更正我)。 So we need to debug it in Firebug? 那么我们需要在Firebug中调试它吗? Then how to incorporate script files like ext-all.js, ext-debug.js into Firebug? 然后如何将ext-all.js,ext-debug.js等脚本文件合并到Firebug中?

Right, the console.log() output from your scripts goes to the console window of the developer tools of whatever browser you're using (eg Firebug for Firefox). 正确,脚本的console.log()输出将转到您正在使用的任何浏览器(例如Firefox的Firebug)的开发人员工具的控制台窗口。 The browser developer tool picks up the script files from the same place the browser does; 浏览器开发人员工具从浏览器所在的位置获取脚本文件; ie however you have them loaded into your web page. 即但是您将它们加载到您的网页。

I would recommend you to use Google chrome. 我建议您使用Google chrome。 It has a very good developer tool. 它有一个非常好的开发人员工具。 Apart from that for ExtJs, use ext-all-dev.js file instead of ext-all.js or ext-all-debug.js while doing any development. 除了用于ExtJs之外,在进行任何开发时,请使用ext-all-dev.js文件而不是ext-all.js或ext-all-debug.js。 It will be really helpful. 这将非常有帮助。 Check this link for more details. 检查此链接以获取更多详细信息。

Also you can set breakpoints by simply using the command debugger; 您也可以通过简单地使用命令debugger;来设置断点debugger; in your javascript file. 在您的javascript文件中。 But to make this work make sure firebug/developer tool is running. 但是要进行这项工作,请确保Firebug /开发人员工具正在运行。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM