FB Like Help!
2014-10-30, 07:55 PM,
Hello guys I want to hide some div id on my website when someone like my page.. but I tried many code and no one works.. is there something wrong with my code?

Please I need your help..
this is the code I'm using
Quote: <script>
FB.Event.subscribe('edge.create', function(response) {



How much you can take and keep moving forward.
That's how winning is done!

Share This Thread :

2014-10-30, 08:55 PM, (This post was last modified: 2014-10-30, 08:58 PM by BlackChico.)
i'm not that expert in codings, i think you should set your display to block then set it to none if you want to hide it

this what i mean..
you should set first the div style display to block then use the code above
hope it helps
Latest Thanks - View all

50cent(2014-11-04 10:48 AM) 
2014-11-04, 10:16 AM, (This post was last modified: 2014-11-04, 10:17 AM by dvLden.)
FB.Event.subscribe('edge.create', function( response ) {
    document.getElementById('spu-title').style.visibility = 'hidden';

Your snippet code contain some errors as I could notice. I removed them but still that bit of code won't do anything. Also what is statement++ increasing ? Because you did not mentioned that.

Either way, this will get you going pretty much.

- First of, here's a DEMO.

- Following code below is a must:


<div class="fb-like" data-href="http://your-website.com" data-layout="standard" data-action="like" data-show-faces="false" data-share="false"></div>

var $body = document.body || document.getElementsByTagName('body')[0],
    $elem = document.getElementById('content-to-hide'),
    fbRoot = document.createElement('div');

fbRoot.id = 'fb-root';

window.fbAsyncInit = function() {
        appId: '533992156714965',
        xfbml: true,
        version: 'v2.1'

    FB.Event.subscribe('edge.create', function() {
        $elem.style.display = 'none';

    FB.Event.subscribe('edge.remove', function() {
        $elem.style.display = 'block';

(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/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

So make sure you apply "APP-ID" which is required by facebook sdk.
Well with all that, I hope I helped you out and made things clear.
Latest Thanks - View all

dahilan01(2014-11-04 11:14 AM) 50cent(2014-11-04 10:48 AM) 

Related Threads
Thread Author Replies Views Last Post
  [HELP] Extended FB permission for App neroazzurro 3 669 2015-04-06, 08:55 AM
Last Post: neroazzurro
  [HELP] “Invalid redirect_uri:" FB APP callmepeige 4 444 2014-05-03, 08:12 AM
Last Post: allworld

About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2018 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top