I don't see what i am doing wrong. The second ajax call doesn't work, like the first
$(".payment").click(function(){
visitorID = $(this).attr('id');
alert("Modal says "+visitorID);
$.ajax({ url: 'update.php',
data: {action: visitorID},
type: 'post',
success: function(output) {
alert(output);
window.location.reload(); //reload so we see the updated values
},
});
});//#end click
$(".generateInvoice").click(function(){
barcode = $(this).attr('barcode');
alert("Modal says "+barcode);
//console.log('hello');
$.ajax({ url: 'generateInvoice.php',
data: {action: barcode},
type: 'post',
success: function(output) {
alert('hi '+output);
//console.log('hie');
//window.location.reload(); //reload so we see the updated values
},
});
});//#end click
With payment i see both alert boxes, but with generateInvoice i only see the first alert box. For testing purpose i have made generateInvoice.php just reading
echo ' there does it work';
die();
But with .generateInvoice the alert in the $.ajax doesn't show
Any info?