title: How to access events created by user in Facebook API by using Javascript?
body: <p>I know very basic of javascript and this is my second call to Facebook API and I am having a problem. I need to read the list of user's events. Here is my code inside a function:</p>
  
  <pre><code>FB.api('/me/events', function(response) {
          console.log("event id: " + response.data[0].id);  
      });
  </code></pre>
  
  <p>Output is:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'id' of undefined
  </code></pre>
  
  <p>I tried to outout this:</p>
  
  <pre><code>FB.api('/me/events', function(response) {
          console.log("event id: " + response.data[0]);  
      });
  
  event id: undefined
  </code></pre>
  
  <p>I have already created couple of events and join couple of events. And also I used this:</p>
  
  <pre><code>FB.api('/me', function(response) {
  
        var str="&lt;b&gt;Name&lt;/b&gt; : "+response.name+"&lt;br&gt;";
            str +="&lt;b&gt;Link: &lt;/b&gt;"+response.link+"&lt;br&gt;";
  </code></pre>
  
  <p>And it works fine. So there shouldn't be a problem with user login. I appreciate if anyone can help me with this.</p>