This blog post is the first in a series of debugging tips and tricks to help you on your way with using Esri's JavaScript API.
Latest Esri JavaScript API tips: debugging your application
blogs.esri.com