i have a function, where if called, will update another object if it exists. thing is, when the page is created the id is not known.
so, for example, heres my code:
$('.slides').on("slidestop", function() {
$this = $(this);
$.ajax({
url: "action.php?event=ITEM "+$this.attr("data-itemID") + " " + this.value+"&itemID="+$this.attr("data-itemID"),
type:'POST',
success: function(result){
//update brightness slider if it exists
$("#sl" + $this.attr('data-itemID')).val(15);
$("#sl" + $this.attr('data-itemID')).slider("refresh");
},
});
});
html:
<input class='dimmerSlider' type='range' id='3' value='4' min='0' max='15' step='1' data-highlight='true' data-itemID='3'/>
error:
Uncaught TypeError: $(...).slider is not a function
$("#$this.attr("data-itemID")").val(15);=>$("#$this.attr('data-itemID')").val(15);