I have a while loop in php that fetches assoc result of a query and then displays them in a class with an id of the user who made that post, im trying to send the id of the class to php as am i sending the num variable however i seem to be getting an undefined index error when trying to send it.
This is what i have so far -
(".eventer button[name=lol]").click(function() {
console.log('clicked');
var ida = this.id;
thisBtn = $(this);
parent = $(this).parent();
num = parent.data('num');
id = parent.data('id');
if (typeof num != 'number') {
num = 0;
$(this).attr('disabled', true);
$.post('javas.php?ida= ' + ida, {
num: (num + 1),
id: id
}, function(data) {
console.log('Ajax success');
parent.next('.status').html(data);
thisBtn.attr('disabled', false); // reset });
console.log('Ajax success');
parent.data('num', ++num);
parent.next('.status').html(data);
thisBtn.attr('disabled', false); // reset
});
});
console.log('-- end');
Any help is appreciated thanks.