1

I have to load a few like buttons by Ajax. I am using Jquery and I get the right html text in response. When I do :

$.ajax({
url: "/app/ajax/load.php",
    type: "POST",
    data: "accessToken="+accessToken,
    dataType: "html",
    beforeSend: function () {            
    },
    success: function (data, textStatus, xhr) {
        $('div#result').html(data);

    }        
});

The like buttons don't appear. Is there a way to fi that ?

Thank you

4

1 に答える 1

3

これを試して

success: function (data, textStatus, xhr) {
    $('div#result').html(data);
    try{
        FB.XFBML.parse(); 
    }catch(ex){}
} 

ajax 呼び出しの後、Facebook のようなボタンを再度初期化する必要があります。

于 2012-07-25T18:14:13.893 に答える