File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Best Practice in JavaScript Debugging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Best Practice in JavaScript Debugging" Watch "Best Practice in JavaScript Debugging" New topic
Author

Best Practice in JavaScript Debugging

Dave Hayward
Greenhorn

Joined: Feb 28, 2007
Posts: 14
Hey Everyone,

I have found that most of my time is spent in trying to debug JavaScript to work cross-browser. I am limited to the "Alert" method of debugging, and I really want to know if there is a better way to debug JavaScript. I focus on IE, Firefox, and Chrome browsers. So a cross-browser tool would be fantastic, but I'll take what I can get.

Thanks a ton,
Einstein47
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
All modern browsers have a JavaScript console. Use console.log

https://developers.google.com/chrome-developer-tools/docs/console
http://msdn.microsoft.com/en-us/library/gg699336%28v=vs.85%29.aspx
https://getfirebug.com/wiki/index.php/Console_API

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Why are you limited to alerts, which are the worst debugging "tool" possible? All modern browsers have built-in JavaScript debuggers (Firebug for Firefox).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dave Hayward
Greenhorn

Joined: Feb 28, 2007
Posts: 14
The reason I am "limited" is because when I taught myself JavaScript back in the late '90s - it was the only option. I have not stayed on top of all the changes in technology (my own fault, you get busy and need to choose what to focus your time on). And now I am getting back into JavaScript editing (mostly to help co-workers), and I wasn't aware of all these great tools.

Thank you very much for your helpful posts.
Einstein47
Ido Green
author
Greenhorn

Joined: Jul 27, 2010
Posts: 25
I would recommend you to watch some of the great videos/tutorial that Paul Irish made on Chrome Dev Tools: http://paulirish.com/?s=devtools
so many powerful tips you can leverage later... ;)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

I do most of my development in Chrome/Safari precisely because of these tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best Practice in JavaScript Debugging
 
Similar Threads
Debugging GWT
Prerequisites needed for Ajax in Action
Debugging in NetBeans
AJAX debugging : Firebug equivalent
selecting a radio button for IE & Netscape