I have the following JavaScript code
<div class="fb-like-box" data-href="snip" data-colorscheme="light"
data-show-faces="false" data-header="false" data-stream="false"
data-show-border="true"></div>
I am trying to detect when the like button is clicked. The above code renders an iframe so my jquery event handler of
$('.fb-like-box > button').on('click', function() { console.log('Clicked'); });
Never fires. I tried wrapping this div and other content in a wrapper div and target that in the $() call but it only fires when the other content is clicked, not the area that is rendered by the Facebook SDK.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…