Hi I tried to make a div remove after clicking the facebook like button in it but Cant do it
here is my code
<div onclick="this.parentNode.parentNode.removeChild(this.parentNode);">
<iframe id='theiframe' scrolling='no' frameBorder='0' allowTransparency='true' src='http://www.facebook.com/widgets/like.php?href="www.facebook.com/makestream"&layout=standard&show_faces=true&width=53&action=like&colorscheme=light&height=80' style='width:53px;height:23px;overflow:hidden;border:0;opacity:"0.8";filter:alpha(opacity="0.8");'></iframe>
</div>
is there a way to remove the div or the ifreme after clicking the facebook like button ?
You cannot capture the click event in the iframe area, since it’s handled by iframe itself and won’t bubble up to the DIV parent. This question on SO may be helpful to you: capture click on div surrounding an iframe
I can imagine one workaround though: take use of Facebook’s SDK and register a listener on the action on like button(see this facebook doc). This article “How to execute JavaScript when the Facebook Like button is clicked” gives some examples.