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?
http://i.imgur.com/xC2E6.jpg
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.
I solved this error by using integers in "min", "max" and "values". Maybe you are setting null values.
The jQuery Slider specification says:
- max Number Default:100
- min Number Default:0
- value Number Default: 0
So "values" are an array of numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With