Monday, May 6, 2013

Spent 20 mins to figure out typo is root cause

Once in a while, we may have typo in our code, sometimes it might not cause issue if it is local variable name, sometime it does result in bug. Today I tried to add tooltip to one div using bootstrap tooltip javascript library, and it gave me the following error

Uncaught TypeError: Object #<Object> has no method 'addClass' bootstrap.js:1168
Tooltip.show bootstrap.js:1168
Tooltip.enter bootstrap.js:1097
e.extend.proxy.g jquery-min.js:2
f.each.f.event.special.(anonymous function).handle jquery-min.js:3
f.event.dispatch jquery-min.js:3
f.event.add.h.handle.i

The error message says there is no method addClass, but the problem is when I write the mockup
<span title="Here is the tooltip info" data-placement="bottom" rel="tooltip">Meet ID</span>, I typed bottome instead of bottom, and I could not find out why it didn't work till I debug.

If I have an IDE with typo check ability, it might save me time.

No comments:

Post a Comment