In the previous several chapters, we have focused on writing script using basic scripting techniques such as conditional statements, functions, and data type manipulation. If you have been trying to incorporate such code into your own Web pages, you may have noticed errors happening on occasion. In this chapter, we'll discuss general code debugging practices and techniques, as well as ways to write code that traps scripting errors automatically.