$(".eventer button[name=lol]").click(function() {
num = $(this).parent().data('num');
if(typeof num != 'number'){
num = 0;
}
$(this).attr('disabled', true); // don't allow a second click until previous action has completed
$(this).parent().data('num', ++num);
$.ajax('javas.php', { success: function(response) {
$(this).parent().next('.status').html(num);
$(this).attr('disabled', false); // reset
})
});
If i comment the ajax part out everything works fine but i need to post the variable num to php so i can store it in a database
Try indenting your code for readability:
Then you’ll see there is an error.
If you look at the jQuery website http://api.jquery.com/jQuery.ajax/
And translate it to yours:
This should work.
You will still need to add your data to the request though: