これは私のcodeです、私は "私のようなプラグインを" レンダリングプラグインを動的に追加する方法は?
HTML
<div id="fb-root"></div><script>window.fbAsyncInit = function() { FB.init({ appId: '1234', channelUrl: 'http://www.mywebsite.com/support/channel.html', status: true, cookie: true, xfbml: true }); }; (function(d) { var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; ref.parentNode.insertBefore(js, ref); } (document)); </script>
<fb:like href="http://www.google.com" send="false" layout="button_count" width="auto" show_faces="true" font=""></fb:like>
<div style="padding-top:30px;">
<a id="addNewLink" href="javascript:void(0);">Add New Facebook's "I Like"</a>
</div>
<div style="padding-top:30px;" id="newFBContent"></div>
jQueryのページの読み込みに
$('#addNewLink').click(function() {
$('#newFBContent').html('<fb:like href="http://www.facebook.com" send="false" layout="button_count" width="auto" show_faces="true" font=""></fb:like>')
});
。リンクをクリックするより新しいものを追加して、それをレンダリングしたいと思います!実際に、.jsライブラリを再度追加するとクラッシュします(明らかに)。
どうすればいいですか?
ご注意:私はiFrameを避けたいです!
[FacebookタグはJqueryを使用して動的に生成されるとレンダリングされません](http://facebook.stackoverflow.com/questions/3305658/facebook-tags-dont-render-when-generated-dynamically-using-jquery) –