title: calling data-onsuccess method for Google sign-in
body: <p>I am trying to integrate <a href="https://developers.google.com/identity/sign-in/web/sign-in" rel="noreferrer">Google Sign In</a> into my web app.</p>
  
  <p>My page has the Google button:</p>
  
  <pre><code>ModalDialogue.cshtml:
  
  &lt;a class="google g-signin2" data-onsuccess="onSignIn"&gt;Sign up with Google+&lt;/a&gt;
  </code></pre>
  
  <p>I'm trying to trigger that method in my js:</p>
  
  <pre><code>ModalDialogue.js:
  
        function onSignIn(googleUser) {
          var profile = googleUser.getBasicProfile();
          console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
          console.log('Name: ' + profile.getName());
          console.log('Image URL: ' + profile.getImageUrl());
          console.log('Email: ' + profile.getEmail());
        }
  </code></pre>
  
  <p>I know that</p>
  
  <p>a] the JavaScript is in the scope of the page, since my other functions - for opening and closing the dialogue - DO work.</p>
  
  <p>b] the button is communicating with Google, since clicking on it DOES open the 'sign-in with Google' dialogue - and then once done - changes the button to 'Sign In' afterward.</p>
  
  <p>How do I trigger the onSignIn method? Or at least how do I determine whether onsuccess is being triggered?</p>