$('.updateDescriptionProduct').click( function() {
if ( updateProductDescription(productID, description) == 'true') {
alert('success!');
} else {
alert('did not update');
}
});
function updateProductDescription(productID, description) {
$.ajax({
url: '/index.php/updateProductDescription',
global: false,
type: 'POST',
data: ({productID: productID, description: description}),
dataType: 'html',
async:false,
success: function(msg){
alert(msg);
return msg;
}
});
}
The function itself says true, but my click
event comes back as undefined
.