Implementing the Logger Control for Debugging

When you’re doing Ajax development, the browser is doing a lot of work behind the scenes, and you can use as much information about what’s going on as you can get. That’s why we like the Logger control in the Yahoo! User Interface Library. It allows you to see messages about the inner workings of any of the YUI components as they are doing their work. And you can pipe (that is, you can write) the output of the Logger to either FireBug (a debugging extension for Firefox) or Safari’s JavaScript Console. It’s a good tool to help you figure out what’s going on when things aren’t working exactly as expected.

You can choose to show the Logger on your page if you want instant feedback (Figure 14.10), or ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.