[jQuery] UI slider 1.6 - how to pass the slider values to an ajax script?
Hi I am a novice to javascript and jquery developer trying to pass
slider values to an AJAX script. My slieder looks like this:
$(function() {
$("#slider-range").slider({
range: true,
min: -10,
max: 66,
//values: [Math.pow(10,2), Math.pow(10,5)],
values: [20, 30],
slide: function(event, ui) {
$("#amount").val('' + (Math.round(Math.pow(10,(ui.values[0] /
10))) ) + ' - ' + (Math.round(Math.pow(10,(ui.values[1] / 10))) ));
}
});
//$("#amount").val('' + $("#slider-range").slider("values", 0) + ' -
' + $("#slider-range").slider("values", 1));
});
How can I pass slider values ui.values[0] and ui.values[1] to a
different javascript function which then via AJAX passes the is to the
ASP script. I tried calling the function like this but it does not
work:
slide: function(event, ui) {
$("#amount").val('' + (Math.round(Math.pow(10,(ui.values[0] /
10))) ) + ' - ' + (Math.round(Math.pow(10,(ui.values[1] / 10))) ));
function myAjax(ui.values[0], ui.values[0]);
}
});
The slieder stops working when I include the function call. What am I
doing wrong? Please help.