You can set a JavaScript function in the data-callback
attribute to handle the
returned credential response. However, you cannot set both the data-login_uri
attribute and the data-callback
attribute. See the following code snippet:
<div id="g_id_onload" data-client_id="YOUR_GOOGLE_CLIENT_ID" data-callback="handleCredentialResponse"> </div> <script> function handleCredentialResponse(response) { ... ... } </script>