title: Facebook request permissions javascript?
body: <p>Trying to do 2 things</p>
  
  <blockquote>
    <p>request offline and user_events permission
    perminant session key</p>
  </blockquote>
  
  <p>Need a feed from facebook for events and there is no rss for it.
  Any help would be greatly appreciated!!!</p>
  
  <p>Currently have the following</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
    &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;
      &lt;!--&lt;title&gt;Connect JavaScript - jQuery Login Example&lt;/title&gt;--&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;div&gt;
        &lt;button id="login"&gt;Login&lt;/button&gt;
        &lt;button id="logout"&gt;Logout&lt;/button&gt;
        &lt;button id="disconnect"&gt;Disconnect&lt;/button&gt;
  
      &lt;/div&gt;
  
      &lt;div id="fb-root"&gt;&lt;/div&gt;
  
      &lt;script type="text/javascript"&gt;
          // initialize the library with the API key
          FB.init({ apiKey: 'apikey' });
  
          // fetch the status on load
          FB.getLoginStatus(handleSessionResponse);
  
          $('#login').bind('click', function () {
  
              FB.Connect.showPermissionDialog('publish_stream');
  
          });
  
          $('#logout').bind('click', function () {
              FB.logout(handleSessionResponse);
          });
  
          $('#disconnect').bind('click', function () {
              FB.api({ method: 'Auth.revokeAuthorization' }, function (response) {
                  clearDisplay();
              });
          });
  
          // no user, clear display
          function clearDisplay() {
              $('#user-info').hide('fast');
          }
  
          // handle a session response from any of the auth related calls
          function handleSessionResponse(response) {
              // if we dont have a session, just hide the user info
              if (!response.session) {
                  clearDisplay();
                  return;
              }
  
              // if we have a session, query for the user's profile picture and name
              FB.api(
            {
                method: 'fql.query',
  
                //Event pull
                query: 'SELECT eid, name, tagline, pic_big, host, description, event_type, event_subtype, start_time, end_time, creator, location, venue FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid =' + FB.getSession().uid + ')'
  
            },
  
            function (response) {
                var user = response[0];
  
                $('#user-info').html('eid: ' + user.eid).show('fast');
  
            }
          );
          }
      &lt;/script&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>