Chapter 18. DEBUGGING JAVASCRIPT AND AJAX

Now that you've mastered the basics of JavaScript, it's time to start writing some complicated scripts of your own. This chapter will help you solve the problems that inevitably arise in writing even simple scripts. The key point is to think before you code. Having a clear idea of how your script will work before you write it will cut down tremendously on your rewriting and bug fixing.

Of course, you can't avoid bugs altogether, so you'll need to learn how to decrease the number of bugs in your scripts and figure out why a program isn't doing what you want. This chapter covers some common debugging tips and techniques, including how to:

  • Write clear and relatively bug-free code

  • Avoid common mistakes

  • Print out ...

Get The Book of JavaScript, 2nd 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.