Use setInterval() to poll to see what the active element is every 50-100ms. If the active element is the Facebook Like button, use setTimeout() to schedule some more Javascript to run in 50ms (like document.location = "whatever").
You may want to delay for more like 1-2 seconds to give time for the Like request to finish being processed on Facebook's end.
I'm not great at javascript or web dev in general but it's incredibly easy to run some code when someone clicks the like button. You might do a bit of the old document.location = "whatever" or whatever you like when they click like.
It's not exactly what you're looking for but I personally use it to show content when they click like at the same time as hiding the like button so they don't unlike it... I just make one div visible and one hidden when they click like.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.