Jquery Detect Click Facebook Like Button
To bridge this gap, Facebook provides the . This SDK creates a sanctioned, secure bridge between your page and the Facebook IFrame. It allows your page to "subscribe" to events that occur within the social plugins.
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <script> // Define this BEFORE the SDK loads window.fbAsyncInit = function() FB.init( appId : 'your-app-id', // Optional for like button xfbml : true, version : 'v18.0' ); // jQuery-powered detection FB.Event.subscribe('edge.create', function(href, widget) $('#output').html('<strong>Liked!</strong> URL: ' + href); ); jquery detect click facebook like button
Once the SDK is ready, you can use the edge.create event to detect when a user clicks the Like button. You can find more details on this process in the guide provided by Jquery Detect Click Facebook Like Button . javascript To bridge this gap, Facebook provides the