Skip to content

Instantly share code, notes, and snippets.

@dorianroy
Created April 25, 2010 18:20
Show Gist options
  • Save dorianroy/378594 to your computer and use it in GitHub Desktop.
Save dorianroy/378594 to your computer and use it in GitHub Desktop.
<link rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/zD5ZK/hash/4146lpfk.css" type="text/css" />
<script type="text/javascript">
var fbURL = PASTE_FACEBOOK_URL_HERE;
function insertLikeButton() {
var container = document.getElementById('flbCont');
var w = container.style.width;
var h = container.style.height;
fbFrame = document.createElement("IFRAME");
fbFrame.setAttribute("src", fbURL);
fbFrame.setAttribute("scrolling", "no");
fbFrame.setAttribute("frameBorder", 0);
fbFrame.setAttribute("allowTransparency", true);
fbFrame.style.border = "none";
fbFrame.style.overflow = "hidden";
fbFrame.style.width = w;
fbFrame.style.height = h;
container.replaceChild(fbFrame, document.getElementById('flb'));
}
</script>
<div id="flbCont" class="connect_widget">
<a id="flb" class="connect_widget_like_button clearfix like_button_no_like" onclick="insertLikeButton();" style="cursor:pointer;-moz-outline-style:none;text-decoration:none"><span class="liketext" style="line-height:1">Show Facebook Likes</span></a>
</div>
@gyanenmhz
Copy link

can u expalin this trick..
u know sir ,"play the video" button is linked with facebook like , when we click it, it published directly to our news feeds http://www.facebook.com/pages/Caution-Wet-Paint-LOL/251653061560367
i'm a newbie

@dorianroy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment