Misspelled object/function calls
Unfortunately the only way of avoiding these types of issues is careful naming of the functions and variables you create. Make sure you avoid names that people misspell often. Functions like startMaintenance() are easy to misspell and screw up. Also, watch your use of letter casing. Functions like getIDBadge() can often be written as getIdBadge(). Sometimes these names are unavoidable. If you did not author the code unfortunately you have no say over what names were used. Just make sure that if you come across an error in your code where a function or variable is undefined, double check that your spelling is correct. If your lucky you can save yourself a lot of time and a headache.
Invalid references to page elements
Accessing the DOM can be a task that can cause great grief if you are not careful. There are a few mistakes that can be made while performing this action. If you find that your code keeps complaining that an element you are trying to access on the page is null even though you swear its there, make sure the id of the element you are using is correct. Remember that element id's are case sensitive so "johnsBlog" is not the same as "JohnsBlog". If you find that events that you are attaching to an element are not firing, invalid element id's may also be the issue. Another possibility to this issue is you may have accidentally used the name specified in the name or class attribute of the element thinking you were accessing the id. If you have to, use copy and paste to make sure you're using the correct value.
When you're developing, sometimes it's easy to get tunnel vision when it comes to your code. Code reviews are a good way to find mistakes early and keep your teams code base in-sync. Performing code reviews can be as easy as having your teammate glance at your code for obvious errors and formatting to being as detailed as having a standard checklist of common issues and team best practices that must be used for each review. There are some good resources out there for understanding the code review process. Steve McConnell's book Software Project Survival Guide has a good section on reviews. His site has a short summary of the code review process you can find here. You need to register to get the pdf but its worth it.