Erwin's Blog

Developing with .NET

Ajax.NET debugging

Most people use alert() to debug their JavaScript, but the Microsoft Ajax Library has a better alterative Sys.Debug. Sys.Debug has some methods for logging messages to the browser console. Like this:

To log a message:
Sys.Debug.trace(“Log to the console”)
To log an object:
Sys.Debug.traceDump(someObject);

You can use Web Development Helper for IE, and Firebug for Firefox to see your console messages. Or use textarea element with the id "TraceConsole" to trace your messages:

<textarea id=”TraceConsolerows=”50cols=”50></textarea>

 

From:

http://weblogs.asp.net/alnurismail/archive/2009/01/12/a-better-alternative-to-using-alert-for-debugging.aspx

Comments

VadimBar said:

Its cool. Because in hard logic i use developer toolbar and if java-code is after minification - very hard to understand anythink

# March 25, 2010 3:06 AM

Twitter Trackbacks for Ajax.NET debugging - Erwin's Blog [asp.net] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Ajax.NET debugging - Erwin's Blog         [asp.net]        on Topsy.com

# March 26, 2010 6:15 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)