Hi, I am trying to host a facebook button as a website with the following code
<div id="fb-root"></div> <script>(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_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); FB.Event.subscribe('edge.create', function(response) { alert("Thank you for liking my page"); } ); </script> <div class="fb-like-box" data-href="https://www.facebook.com/mypage" data-width="292" data-show-faces="true" data-stream="true" data-show-border="true" data-header="true"></div>
But the FB.Event function does not work when I tested, I think I can use this trigger event only if I use FB.init and work inside the fbAsyncInit () function. This became known through web search.
I definitely do not know these things. Now the problem is that Fb.init requires appId, channelUrl and a few more. I am confused, I have not created any application, and I am not creating. I'm just trying to put facebook as a button on my website, whereas I can provide an appId.
Can someone explain to me about this appId.Does he had to create as a button and create Fb.event when a user likes my page, how to thank them, or am I using this code incorrectly?
source share