profile
viewpoint

Ask questionsUislider already loaded

After I upgrade to noUiSlider 14.0.x and jquery to 3.4.1 I am experiencing a rather strange bug. We use noUISlider on all our sliders on noteb.com, including here on this page: https://noteb.com/?search/adv_search.php

However, once every a few dozen to one hundred loads of https://noteb.com/?search/adv_search.php, we get this error: https://i.imgur.com/I2Rqdhw.png Uncaught Error: noUiSlider (14.0.2): Slider was already initialized The error is given by any of the sliders on that page, usually not the same one.

The error appears at random, on any browser and I have failed so far to create a working test scenario to reproduce it.

I am not doing anything crazy to the sliders, just create and update. I have also tried to prevent the error by wrapping the slider creation in an if condition but so far without success.

So far I can only conclude that there is a bug either on the server-side (Apache) or in the JS, maybe even the noUiSlider code.

Any support or input will be greatly appreciated.

leongersen/noUiSlider

Answer questions Bllacky

Sure. This is the js that has the noUiSlider code. https://noteb.com/search/lib/js/adv_search_post.js

And this is how I wrapped the creation in an if:

//CREATE CPU DATE SLIDER
if(document.getElementById('launchdate').noUiSlider===undefined)
{	
	noUiSlider.create(document.getElementById('launchdate'), {
		start: [cpumindateset, cpumaxdateset],
		connect: true,
		step: 1,
		direction: 'ltr',
		format: { to: function(value){ return parseInt(value); }, from: function(value){ return parseInt(value); } },
		range: {
			'min': [cpumindate],
			'max': [cpumaxdate]		
		}
	});
}

I made a few more changes yersterday and I am waiting on user feedback to see if anyone is still getting the error. Since its a random error, it may take a few days until I get confirmation it hasn't creeped up again.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List