我有打印發表評論 AJAX腳本我想補充裝載機在服務器查詢工作插件加載器的AJAX代碼
什麼,我需要添加到「成功」才能看到LOADER在我的HTML頁?
function printComments (obj) {
var element = $(obj);
var contactID = element.attr("contactID");
var type = element.attr("id");
var info = 'contactID=' + contactID + "&type=" + type + "&catID=" + catID;
$("#loader").html('<img src="images/loading.gif" align="absmiddle">');
// alert(info);
$.ajax({
type: "POST",
url: "ajax/followPrint.php",
data: info,
success: function(msg){
if (type == "followsTab")
$("#follows").html(msg);
if (type == "commentsTab")
$("#commentsContent").html(msg);
}
});
return false;
}