jQuery(function ($) {
/* fetch elements and stop form event */
$("form.follow-form").submit(function (e) {
/* stop event */
e.preventDefault();
/* "on request" */
$(this).find('i').addClass('active');
/* send ajax request */
$.post('listen.php', {
followID: $(this).find('input').val()
}, function() {
/* find and hide button, create element */
$(e.currentTarget)
.find('button').hide()
.after('<span class="following"><span></span>Following!</span>');
});
});
});
我想知道什麼時候我在listen.php文件中處理mysql查詢,它是如何deos它成功的消息回來,然後執行更改後?成功通話後訪問jquery函數?
查看更新! ;) – 2010-09-09 13:08:55