Help! Uncaught TypeError: Cannot read property 'events' of undefined

899 views
Skip to first unread message

kuko...@gmail.com

unread,
Jan 2, 2015, 12:51:55 PM1/2/15
to google-api-jav...@googlegroups.com
I'm using API JavaScript Client with Calendar, but I have an error!
Perhaps somebody knows what is happening.

Thanks a lot.

This is the error:

Uncaught TypeError: Cannot read property 'events' of undefined

And this is my code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8' />       


        var apiKey = 'xxxxxxx';
   

        function makeRequest(){
            console.log('Google Calendar API loaded.');

            gapi.client.calendar.events.list({'calendarId' : 'xxxxxxxx'}).then(function(resp){ //This line throws the error
                console.log(resp.result.item);
            }, function(reason){
                console.log('Error '+reason.result.error.message);
            });
  
        }
   
   
        function init(){
            gapi.client.setApiKey(apiKey);
            gapi.client.load('Calendar API', 'v3').then(
                makeRequest()
            );
        }
 
    </script>

    <script type="text/javascript" src="https://apis.google.com/js/client.js?onload=init"></script> 

  </head>
 
  <body>
   
   
  </body>
</html>

Gagan Adlakha

unread,
Dec 1, 2015, 2:43:24 PM12/1/15
to Google API JavaScript Client
Hello, m Gagan 
M also facing exactly same issue with some API, Have u got any solution to same & can u help me out in sorting out ?

Thanks in advance

vin...@grazitti.com

unread,
Jun 9, 2016, 8:09:35 AM6/9/16
to Google API JavaScript Client
I am also facing but i am facing while i am inserting the event.

Thanks


On Friday, January 2, 2015 at 11:21:55 PM UTC+5:30, Francisco Aragón Royón wrote:
Reply all
Reply to author
Forward
0 new messages