Is it possible to detect when someone clicks the like button "and before the like action really occurs",
i.e. same as onSubmit
JS event, it detects when the user submit the form before it even get submitted, giving the ability to process/run some code before it do so.
Usage:
I am trying to implement a Web 2.0 page where all the action happens in one page, so depending on the user actions the content of the page would change "But not the meta"
So my question is, can I detect when the user "clicks" the like button so I can "load" the meta of the current page before the like action really happens?
P.S, I do know that it's not a big deal to load the meta as it's less than 1KB and won't have any effect, however I am just curious if there is any way/ work around to do so.
Clicking Like below a post on Facebook is a way to let people know that you enjoy it without leaving a comment. Just like a comment, anyone who can see the post can see that you liked it. For example, if you click Like below a friend's video: People who can see the video will be able to see that you liked it.
When a user clicks the like button, the content appears in the News Feeds of that user's friends. The button also displays the number of users who liked each piece of content, and may show a full or partial list of those users.
You can subscribe to an event that will notify you when the user likes something - however this will fire after the action. This is documented at: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/
An example would be:
FB.Event.subscribe('edge.create', function(response) { alert('You liked the URL: ' + response); /* check the response here to see if it's your URL */ });
You could attempt to intercept the action but why would you want to wait to add the meta? Do you mean the open graph headers? Facebook scrapes these every 24-hours, not for each unique like event. Also it would most likely be against Facebook's terms to intercept/alter the like action, as you'd be interfering with their established and expected guidelines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With