How can we show facebook share button after page loads?
I am trying to show Facebook share button after the web page is loaded using window.onload
function. The code using iframes are working fine for Facebook like button but when I put code for fshare button, its just printed and nothing else happens the code is as follows :
function ImagesocialButtons() {
if (document.getElementById("social_wrap")) {
var socialCode = "";
socialCode += "<div class=\"social_btn\">";
socialCode += "<iframe src=\"http://www.facebook.com/plugins/like.php?href="
+ escape(document.URL) + "&layout=button_count&show_faces=false&width=90&action=like&colorscheme=light&height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:90px; height:21px;\" allowTransparency=\开发者_开发知识库"true\"></iframe>";
socialCode += "</div>";
socialCode += "<div class=\"social_btn\">";
socialCode += "<a name=\"fb_share\" type=\"button_count\" href=\"http://www.facebook.com/sharer.php\">Share</a><script src=\"http://static.ak.fbcdn.net/connect.php/js/FB.Share\" type=\"text/javascript\"></script>";
socialCode += "</div>";
document.getElementById("social_wrap").innerHTML = socialCode; } }
window.onload = ImagesocialButtons;
I think its not possible. I try something like that but with an ajax pagination, and the "like" button never load again, i think its becase when the code is loaded and needs to be loaded before the page load.
精彩评论