i have created a circle with jquery-knob. <input type="text" value=0 class="timecycle"/>
. Now if I want to change the value, right after I created the circle, my circle is:
$(".timecycle").knob({ min: 0,max: 50,width: 292,height: 292,fgColor: '#00BB00',bgColor: '#eeeeee',thickness: '.05',readOnly: true});
$(".timecycle").val(25).trigger('change');
Well, but I want to change the value dynamically via ajax-Request. But now if I try to change the value within my ajax-request, the circle is not filling (but the value is updating; if i set value to "2", the value will be "2" (I debugged it already) but my circle remains empty). How can i change my value correctly with ajax, so that my circle is changing. Here is my current code:
$(document).ready(function(){
setInterval(function(){
$.ajax({
type: "POST",
url: "assets/php/ajax.php",
data: "do=check",
success: function(e) {
var json = JSON.parse(e);
$('.timecycle').val(json[0]).trigger('change');
console.log(json); // json[0] = 2 and value the value was successfully set, but is not triggering
}
});
}, 3000);
});