Can't you use a variable in a load() command?
In my AJAX Script :
var $self = $(this);
var uniqueID = $self.data('id'); //getting ID dynamically (e.g 256)
var myclass = ".likes-"+uniqueID;
Then in the success callback :
alert(myclass);
Returns as expected :
.likes-256
But the following in the success callback :
$(myclass).load(location.href + myclass);
Doesn't work.
What am I doing wrong?
Ahh ok I see where I was going wrong.
This is the correct way to do it :
$(".likes-"+uniqueID).load(location.href + " .likes-"+uniqueID);