I had this old jQuery UI slider that had worked just fine a few months ago, but now I seem to be getting an exception reading: Cannot call method ‘addClass’ of undefined. I’ve checked the values being passed into the slider and they’re regular Javascript dates.
$('#dateFilter').click(function() {
return $('#sliderContainer').slideToggle(200);
});
$(function() {
var endFiling, startFiling;
startFiling = Date.parse($('#startFiling').val());
endFiling = Date.parse($('#endFiling').val());
return $('#filingDateSlider').slider({
range: true,
min: startFiling,
max: endFiling,
step: 86400000,
values: [startFiling, endFiling],
slide: function(event, ui) {
var eD, end, sD, start;
sD = new Date(ui.values[0]);
start = dateFormat(sD);
eD = new Date(ui.values[1]);
end = dateFormat(eD);
$('#filingStartDate').text(start);
return $('#filingEndDate').text(end);
}
});
Is there a particular reason why I might be getting this new error?
For anyone reading back on this question, if you’re pulling from a CDN, try pulling from the latest jQuery UI version. I also got this problem, and it was solved by using a later jQuery UI version.