Note that there are some explanatory texts on larger screens.

plurals
  1. POfacebook 'like' button for facebook page but with callback
    text
    copied!<p>I want to use the facebook like button for a facebook fan page, but with a callback function.</p> <p>So far I've only managed to get the callback function to work with a facebook app with the following code-</p> <pre><code>&lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt; &lt;script&gt; FB.init({ appId : 'appID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse XFBML channelUrl : 'http://www.my_url.com/channel.html', // channel.html file oauth : true // enable OAuth 2.0 }); &lt;/script&gt; &lt;script&gt;(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); FB.Event.subscribe('edge.create', function(href, widget) { callbackFunction(); }); &lt;/script&gt; </code></pre> <p>Like I said, the above code works fine for a facebook app. But what I really want to do is bind code similar to this, but to a facebook page 'like' button such as the following-</p> <pre><code>&lt;div class="fb-like-box" data-href="https://www.facebook.com/{page-name}" data-width="292" data-height="250" data-show-faces="true" data-stream="true" data-header="true"&gt;&lt;/div&gt; </code></pre> <p>Does anyone know of a way to achieve this?</p> <p>Many thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload