For years now, debugging JavaScript has not been the easiest thing to accomplish because there has been a lack of tools and a lack of native ways of doing so. Of course, there has always been the simple, yet trusty, alert debugging, shown in Figure 8.1, and the more sophisticated alert debugging approaches involving the onerror event. Figure 8.1. Trusty alert debugging. This chapter will briefly cover the more sophisticated methods of alert debugging that can be achieved with the onerror event and responseText property from the XHR object. With that in mind, the main focus of this chapter will be to discuss a few tools that will help us debug our Ajax applications with extreme ease and leave us wondering how we ever developed without them. These tools are the Internet Explorer (IE) Developer Toolbar, Safari Enhancer, and my personal favorite, FireBug. This chapter will also feature screenshots from the final application, which we will debug with the various approaches that we will be discussing throughout this chapter. Let's get started by covering JavaScript's own onerror event. |