title: Building an app on Facebook using JS SDK
body: <p>I am trying to build a simple "app" on Facebook that will display alternate content depending if a user "likes" my page.</p>
  
  <ol>
  <li>Why the following JS doesn't work (doesn't send the response back. No
  response = no like, array = response)? When I process the query on
  FB query tester it works.</li>
  <li><p>Why does it generate the following error?</p>
  
  <pre><code>&lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    FB.init({
      appId  : 'APP_ID',
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml  : true, // parse XFBML
      channelUrl : 'http://domain.com/tab/', // channel.html file
      oauth  : false // enable OAuth 2.0
    });
  
   (function($) {
  
    var session = FB.getSession();
        FB.api({
             method: 'fql.query',
             query: 'SELECT uid, page_id FROM page_fan WHERE uid=me() AND page_id=APP_ID'
        },
     function(response) {
        if(response instanceof Array &amp;&amp; response.length &gt; 0)
            alert("YOU LIKE US!");
        else
            alert("YOU DON'T LIKE US YET!");
     });
   })(jQuery);
  &lt;/script&gt;
  </code></pre></li>
  </ol>
  
  <p>Error</p>
  
  <pre><code>Object { error_code="104", error_msg="Requires valid signature", request_args=[7]}
  </code></pre>