$(function(){ $("a.grey-button").each ( function () { $( this ).bind ( "click", function(){ $.ajax({ type: "POST", url: "http://www.chartsinfrance.net/ajax_fav.php", data: "type=alb&id_album="+$(this).attr("id"), success: function(reponse){ $("span#text_fav").html(reponse); }, }); } ); } ); function lastPostFunc() { $('div#lastTitlesLoader').html(''); $.post("http://www.chartsinfrance.net/ajax-titres.php?artiste=Yelle&id_artist=52997&lastID="+$(".memeartiste:last").attr("id"), function(data){ if (data != "") { $(".memeartiste:last").after(data); } else { $('div#load_more').hide(); } $('div#lastTitlesLoader').empty(); }); }; $("#load_more > a").click(function(){ lastPostFunc(); return false; }); });