Blog Moved ....

ScottCate.com

community

frenz

my book(s)

my products

Javascript Trace

My Javascript Tip (or prointer) of the day.

Are you using alert('my message'); to debug your javascript?

This little tool is a must have and will change your javascript coding forever.

Add tracing to your javascript functions with jsTrace. What a great little util. I had it up and running < 5 minutes, and I can't image I'll write another line of javascript without using this tool.

It consists of two JS files, that you simply remove before you deploy.

Comments

Mihir Solanki said:

Excellent !, yes you are right, can't imaging writing javascript without using it.
# December 4, 2005 5:53 AM

Dror Engel said:

I found it very useful , thank you
Dror.
# December 4, 2005 6:37 AM

Chris Martin said:

This rules dude!!! Thanks.
# December 8, 2005 1:05 PM

Jean Hallow said:

This thing is incredible! Thanks very much.
# August 30, 2006 10:15 AM

Jamie said:

Awesome script!  Thanks for the link.  I'll never write another alert('here'); again!

# December 14, 2006 4:27 PM

Jeffrey said:

Damn I happy now! :D

# May 21, 2007 3:46 PM

statement of teaching philosophy example said:

statement of teaching philosophy example

# September 15, 2007 11:36 PM

parker said:

FYI, if you've been using firebug (as you should), you can use "window.console.log(output goes here)" to output to the firebug console.  This is especially handy since instead of giving you a generic [html object] when passed an HTML element, firebug will give you the full tag with attributes and a link to the element in the DOM explorer.  Additionally, arrays will be displayed in shorthand [item1, item2, item3] form.

Unfortunately, this only works with firefox.  I personally use this custom function when developing across multiple browsers.  It utilizes the console if available, otherwise reverts to old school alert method.

function log(s)

{

window.console ? window.console.log(s) : alert(s);

}

I  use firebug for development and then check all the other browsers every time I change anything.  Tedious, maybe, but far superior to designing the page in it's entirety only to discover that something somewhere along the way broke IE6.

# October 3, 2007 6:08 PM

Gabor said:

Ehh.. I should have known about this earlier! So I wouldn't have spent a whole night programming it on my own... But never mind, this way i got some practice in creating js windows. Though my version lacks the resize function, but it is semi transparent (so doesn't hide website content) also can be dragged, cleared and closed, and stands of just one file.

So I can agree: if you begin to use such a tool, you will never want to program js without it. :)

# February 26, 2008 10:39 AM

Carro Brasília said:

I'm search for a javascript function cabable to dump object, array and html DOM object like firebug. I want to use it with IE6.

# May 31, 2008 5:15 PM

scott cate said:

Sys.Debug.trace and Sys.Debug.traceDump offer this for ie/ff if your using MSFT ASP.NET Ajax

# June 13, 2008 8:52 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)