[Answered ]-JQuery – Error in event handler for 'undefined': TypeError: Cannot call method 'replace' of undefined

2👍

I almost guarantee that if you log $('.vote_value'), you’ll get undefined. Make sure you have an element with that class present in the dom.

0👍

You can also get this error if you ask for the html() of a <title> element. For example:

var title = $('title');
var t = title.html();
//-> Error in event handler for 'undefined': TypeError: Cannot call method 'replace' of undefined
var t = title[0].childNodes[0].nodeValue;
//-> "Welcome to My Page!"
👤Phrogz

0👍

I’ve that error too. I’ve just turned off an “adBlock” extension. Than I restarted my server and the error disappered.

👤vlad

Leave a comment