title: Uncaught TypeError: undefined is not a function on Google Plus Login
body: <p>I'm trying to implement Google plus login and its my code </p>
  
  <pre><code>$('#GPlogin').on('click', function () {
  
    var myParams = {
      'clientid' : 'My ID.apps.googleusercontent.com',
      'cookiepolicy' : 'single_host_origin',
      'callback' : 'GPlogin',
      'approvalprompt':'force',
      'scope' : 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read'
    };
    gapi.auth.signIn(myParams);
  
  }); 
  
  
  function GPlogin(result)
  {
      console.log(result);
      if(result['status']['signed_in'])
      {
          var request = gapi.client.plus.people.get(
          {
              'userId': 'me'
          });
          request.execute(function (resp)
          {
              var email = '';
              if(resp['emails'])
              {
                  for(i = 0; i &lt; resp['emails'].length; i++)
                  {
                      if(resp['emails'][i]['type'] == 'account')
                      {
                          email = resp['emails'][i]['value'];
                      }
                  }
              }
  
              var str = "Name:" + resp['displayName'] + "&lt;br&gt;";
              str += "Image:" + resp['image']['url'] + "&lt;br&gt;";
              str += "&lt;img src='" + resp['image']['url'] + "' /&gt;&lt;br&gt;";
  
              str += "URL:" + resp['url'] + "&lt;br&gt;";
              str += "Email:" + email + "&lt;br&gt;";
              console.log(str);
          });
  
      }
  
  }
  
  
  function onLoadCallback()
  {
      //gapi.client.setApiKey('My API Key'); //set your API KEY
      gapi.client.load('plus', 'v1',function(){});//Load Google + API
  }
  
  
  
  (function() {
    var po = document.createElement('script');
    po.type = 'text/javascript'; po.async = true;
    po.src = 'https://plus.google.com/js/client:plusone.js?onload=loadGApi';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(po, s);
  })();
  </code></pre>
  
  <p>For first time modal window asked my for permissions and then in console i got error  </p>
  
  <blockquote>
    <p>Uncaught TypeError: undefined is not a function</p>
  </blockquote>
  
  <p>after when I'm pressing on login button modal asks my for offline use permission and am getting the same error in console </p>