cannot call methods on slider prior to initialization attempt to call method 'value'

Have you considered a different approach. Setup a hidden field with the initial value -> populate the value from the code-behind, then do something like:

$(function () {
    $("#slider-vertical").slider({
        value: $("#hiddenFieldWhatever").val(),
        // setup the rest ...
    });  
});

I hope I understood your requirements correct.


var slider = $("#slider-vertical");

var a = function() {
    if(slider.slider("instance")) {
        slider.slider('value', 1);
        console.log('set value');
    } else {
        console.log('ERROR: cannot set value prior to initialization');
    }
}

var b = function() {
    slider.slider();
    console.log('initialized');
}

a();
b();
a();