Write to the SharePoint 2010 Developer Dashboard With JavaScript

Write to the SharePoint 2010 Developer Dashboard With JavaScript

When developing JavaScript solutions, I like to provide a tracing mechanism that can be turned on and off to aid debugging. The IE Developer Tools, debugger and Fiddler are very robust debugging tools, but they don’t enable client script code to trace custom messages to a “log” that can be reviewed by developers. The SharePoint 2010 Developer Dashboard is designed for server-side tracing, but it can also be used for client-side trace messages. The approach is simple: tracing code in your client script appends html to the Developer Dashboard when the Dashboard is visible. Here is the JavaScript (note this version depends on jQuery):