I can't get noUISlider to work Here my code snippet:
<script>
var handlesSlider = document.getElementById('slidertest');
noUiSlider.create(handlesSlider, {
start: [ 4000, 8000 ],
range: {
'min': [ 2000 ],
'max': [ 10000 ]
}
});
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TEST</title>
<link rel="stylesheet/less" type="text/css" href="css/style.less"/>
<link href="css/nouislider.min.css" rel="stylesheet">
<script src="scripts/less.js"> </script>
<script src="scripts/jquery-2.1.4.min.js"> </script>
<script src="scripts/jquery-ui.min.js"> </script>
<script src="scripts/dropzone.js"> </script>
<script src="scripts/nouislider.min.js"> </script>
</head>
...
<div id="slidertest"></div>
I can't get noUISlider to work Here my code snippet:
<script>
var handlesSlider = document.getElementById('slidertest');
noUiSlider.create(handlesSlider, {
start: [ 4000, 8000 ],
range: {
'min': [ 2000 ],
'max': [ 10000 ]
}
});
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TEST</title>
<link rel="stylesheet/less" type="text/css" href="css/style.less"/>
<link href="css/nouislider.min.css" rel="stylesheet">
<script src="scripts/less.js"> </script>
<script src="scripts/jquery-2.1.4.min.js"> </script>
<script src="scripts/jquery-ui.min.js"> </script>
<script src="scripts/dropzone.js"> </script>
<script src="scripts/nouislider.min.js"> </script>
</head>
...
<div id="slidertest"></div>
And I'm getting this error: Uncaught TypeError: Cannot read property 'nodeName' of null
Share Improve this question asked Jul 24, 2015 at 0:42 JuloiusJuloius 2631 gold badge4 silver badges11 bronze badges 4- the error is related to what file exactly or what line ? – Mouhamed Halloul Commented Jul 24, 2015 at 0:58
- File: nouislider.min.js:3 and Line 3 is nearly the whole code, its too long to post it here :/ – Juloius Commented Jul 24, 2015 at 1:04
- Try debugging with the non-minified versions. – Nathan Tuggy Commented Jul 24, 2015 at 1:06
- okay i changed the min version to the unpressed version and now the target line is: "if ( !target.nodeName ) {" – Juloius Commented Jul 24, 2015 at 1:07
1 Answer
Reset to default 6try surrounding your javascript with :
$( document ).ready(function() {
var handlesSlider = document.getElementById('slidertest');
noUiSlider.create(handlesSlider, {
start: [ 4000, 8000 ],
range: {
'min': [ 2000 ],
'max': [ 10000 ]
}
});
});