External Site: Show content if page is liked problem

So what I’m trying to do is get the content in <div id=content> to show if the page has been “liked”. I got it to work if the user has just pressed the like button, but if the page refreshes, or the user comes back at a later time, it remembers that the user likes the page (of course), but it does not show the content in <div if=content> unless the user unlikes and then likes the page again. Im guessing this is because what the code is referencing is some sort of click event, rather than if the page is liked or not.

Here is the link:


Here is the code:

<html xmlns="http://www.w3.org/1999/xhtml"
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>WD Fan Page</title>
<meta property="og:title" content="WD Fan Page"/>
<meta property="og:type" content="company"/>
<meta property="og:url" content="jackthe7th.dyndns.org/test"/>
<meta property="og:site_name" content="WD Fan Page"/>
<meta property="fb:admins" content="560504907"/>
<meta property="og:description"
content=" fan page Like"/>
<script type="text/javascript" src="jquery.js"></script>
<style type="text/css">
#content { 
display: none;
padding: 20px 0 0 0;
    <h1>WD Fan Page</h1>
<div id="fb-root"></div>
<p><fb:login-button autologoutlink="true"></fb:login-button></p>

window.fbAsyncInit = function() {
FB.init({appId: '205453252832209',
status: true, 
cookie: true,
xfbml: true});
 FB.Event.subscribe('auth.login', function() {

FB.Event.subscribe('edge.create', function(href, widget) {
FB.Event.subscribe('edge.remove', function(href, widget) {
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
e.async = true;


<div id="content"> This content shows up when user likes page <br />
if you unlike this page it will go away!


edge is an element used to flag a like in real time, not a previous one.

Basically you would use edge to thank the user for having just liked something via ajax or with an alert.

yeah, so how would i do it for a previous one?


You can parse the Graph API if you get permission from the user. Upside of this is working on specific pages, downside is the permission bit and code involved. I’m not sure if there’s a solution that’s easier for an entire site; searching around did not yield much on a direct path.


For an app it’s more direct as this is passed right too the page.