Set Jquery slider value from JSON

482 views Asked by At

I have a Jquery range slider (two values). I am trying to set the value from JSON:

$.ajax({
        url: '/SensorDatas/LoadSettings',
        type: 'GET',
        contentType: 'application/json;',
        dataType: "json",
        async: true,
        processData: false,
        cache: false,
        success: function (result) {
            $("#sensor1slide").slider('option','values',0, result.sensor1min);
            $("#sensor1slide").slider('option','values',1, result.sensor1max);
        },
        error: function (xhr, ajaxOptions, thrownError) { alert(xhr.responseText); $("#loading").val("Error"); }
    })

My sliders are not being updated, even though I know the values are being returned. I was wondering if it was because they are not cast correctly?

When I analysis the browser console I get this error:

TypeError: $(...).slider is not a function
$("#sensor1slide").slider('option','values',0, result.sensor1min);
0

There are 0 answers