$('.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;
}
});
}
函数本身说的是对的,但是我的click
事件返回为undefined
。jQuery Ajax返回undefined
你究竟在做什么? – 2010-08-15 01:05:26