คุณสามารถทำได้ใน JavaScript เช่นนี้ (การสร้างจากคำตอบของ@ dwarfy สำหรับคำถามที่คล้ายกัน ):
<html>
  <head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <style type="text/css">
      div#container_notlike, div#container_like {
        display: none;
      }
    </style>
  </head>
  <body>
    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : 'YOUR_APP_ID', // App ID
          channelUrl : 'http(s)://YOUR_APP_DOMAIN/channel.html', // Channel File
          status     : true, // check login status
          cookie     : true, // enable cookies to allow the server to access the session
          xfbml      : true  // parse XFBML
        });
        FB.getLoginStatus(function(response) {
          var page_id = "YOUR_PAGE_ID";
          if (response && response.authResponse) {
            var user_id = response.authResponse.userID;
            var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
            FB.Data.query(fql_query).wait(function(rows) {
              if (rows.length == 1 && rows[0].uid == user_id) {
                console.log("LIKE");
                $('#container_like').show();
              } else {
                console.log("NO LIKEY");
                $('#container_notlike').show();
              }
            });
          } else {
            FB.login(function(response) {
              if (response && response.authResponse) {
                var user_id = response.authResponse.userID;
                var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
                FB.Data.query(fql_query).wait(function(rows) {
                  if (rows.length == 1 && rows[0].uid == user_id) {
                    console.log("LIKE");
                    $('#container_like').show();
                  } else {
                    console.log("NO LIKEY");
                    $('#container_notlike').show();
                  }
                });
              } else {
                console.log("NO LIKEY");
                $('#container_notlike').show();
              }
            }, {scope: 'user_likes'});
          }
        });
      };
      // Load the SDK Asynchronously
      (function(d){
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js";
        d.getElementsByTagName('head')[0].appendChild(js);
      }(document));
    </script>
    <div id="container_notlike">
      YOU DON'T LIKE ME :(
    </div>
    <div id="container_like">
      YOU LIKE ME :)
    </div>
  </body>
</html>
โดยที่ไฟล์ channel.html บนเซิร์ฟเวอร์ของคุณมีเพียงบรรทัด:
 <script src="//connect.facebook.net/en_US/all.js"></script>
มีการทำสำเนาโค้ดเล็กน้อยในนั้น แต่คุณได้รับแนวคิด สิ่งนี้จะปรากฏขึ้นในกล่องโต้ตอบการเข้าสู่ระบบในครั้งแรกที่ผู้ใช้เข้าชมเพจ (ซึ่งไม่เหมาะอย่างยิ่ง แต่ก็ใช้ได้ผล) ในการเยี่ยมชมครั้งต่อ ๆ ไปจะไม่มีอะไรปรากฏขึ้น