I\'m looking to detect if a Facebook share on a page was successful, and upon success change the value of a box. I can handle the latter just fine, but am a little lost as
Firstly you must include Facebook sdk.js library to use all its methods (ideally right after the opening of body tag)
The problem with your http://jsfiddle.net/ysdp60cz/ is the scope of the facebookShare var. So, in this example, just include it in the window object:
window.facebookShare = function( callback ) { [...]
I don´t know how are you organizing your code, however, with this changes it must work.
You can check it here: http://jsfiddle.net/benjasHu/3dhq9k21/
Cheers.