Uncaught: TypeError: undefined...
Why?
- Usually leads you directly to the problem
- understanding it helps you understand the system
- know how to read between the lines
- knowing helps you be faster at debugging
Anatomy of an Error
The Error: Uncaught: TypeError: undefined is not a function filename:# onClick jQuery.event.dispatch alemData.handle
The Call Stack (stacktrace)
- The Error Site: Place where error occurred.
- Call Sites (Stackframes): Chain of function calls that lead up to the point of the error.
Your Code v. 3rd Party Code
Reading Between the Lines
ReferenceError: $ is not defined
$(function(){...});
Consult Google
#2 Test Your Assumptions
Troubled Programmer: "Help! It's not working. I think it is..."
Wise Programmer: "If you think it is that, then verify it. Why do you think it is the problem."
Why does this have to happen?
The Streetlight Effect (Observational Bias)
Policeman helps Casey to find keys.