首页 > 解决方案 > 意外的标记

问题描述

我和我的朋友正在尝试从头开始制作一个网站,但我们几乎没有接触过 html。我们有一个私有域,但我们刚刚开始,似乎不知道如何定义第 29 行发现的这个意外令牌。任何帮助将不胜感激。这是限制我们运行代码的唯一因素(我认为)。

<a href="#" onclick="signOut();">Sign out</a>

第 29 行的图像(据说令牌是意外的)

输出

第 28-44 行

    <meta name="google-signin-scope" content="profile email">
    <meta name="google-signin-client_id" content="936710688088-5fupofi0g9i8nb2ua7tftc9gkt4ndhue.apps.googleusercontent.com">
    <script src="https://apis.google.com/js/platform.js" async defer>
    </script>
    <title></title>
</head>

<body>
    <div class="g-signin2" data-onsuccess="onSignIn" data-theme="dark"></div>
    <script>
        function onSignIn(googleUser) {
        // Useful data for your client-side scripts:
        var profile = googleUser.getBasicProfile();
        console.log("ID: " + profile.getId()); // Don't send this directly to your server!
        console.log('Full Name: ' + profile.getName());
        console.log('Given Name: ' + profile.getGivenName());
        console.log('Family Name: ' + profile.getFamilyName());
        console.log("Image URL: " + profile.getImageUrl());
        console.log("Email: " + profile.getEmail());

        // The ID token you need to pass to your backend:
        var id_token = googleUser.getAuthResponse().id_token;
        console.log("ID Token: " + id_token);
      }
    <a href="#" onClick="signOut();">Sign out</a>                                                  

  function signOut() 
  {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () 
    {
      console.log('User signed out.');
    });
  }

    </script>
    
</body>

</html>```

标签: htmloutputunexpected-token

解决方案


推荐阅读