简体   繁体   中英

Debugging ExtJS 4 using console.log()

I am very new to ExtJS and still going through the Docs in Sencha site. I've seen a lot of examples in ExtJS4 using console.log() for debugging. However I couldn't figure out how to deal with 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). So we need to debug it in Firebug? Then how to incorporate script files like ext-all.js, ext-debug.js into 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). 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. 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. It will be really helpful. Check this link for more details.

Also you can set breakpoints by simply using the command debugger; in your javascript file. But to make this work make sure firebug/developer tool is running.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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