Telegram登录小部件未显示出来。

huangapple go评论62阅读模式
英文:

Telegram login widget not showing up

问题

抱歉,我是一个完全的新手。
我部署了这个网站
https://visionary-cupcake-b69c3d.netlify.app/

  1. 为了测试,我使用了代码的这一部分:
    </script>
    <!-- 添加的 Telegram 脚本的开头 -->
  <script async src="https://telegram.org/js/telegram-widget.js?22" data-telegram-login="Guardian200_bot" data-size="large" data-auth-url="ya.ru"></script>
    </script>
    <!-- 添加的 Telegram 脚本的结尾 -->
  1. 我的机器人已经注册,并且我指定了 [visionary-cupcake-b69c3d.netlify.app] 作为域名。
  2. 网站正在使用所需的 HTTPS 协议。

然而,登录小部件没有显示出来。可能的原因是什么?

我已经重新部署了它多次,检查了来自这里 https://core.telegram.org/widgets/login 的各种设置,但都没有成功。

英文:

Sorry I am a total newb.
I deployed this site
https://visionary-cupcake-b69c3d.netlify.app/

  1. used this part of the code for the test
    &lt;/script&gt;
    &lt;!-- Start of the added Telegram script --&gt;
  &lt;script async src=&quot;https://telegram.org/js/telegram-widget.js?22&quot; data-telegram-login=&quot;Guardian200_bot&quot; data-size=&quot;large&quot; data-auth-url=&quot;ya.ru&quot;&gt;&lt;/script&gt;
    &lt;/script&gt;
    &lt;!-- End of the added Telegram script --&gt;
  1. my bot is regstered and I specifiyed [visionary-cupcake-b69c3d.netlify.app] as a domain
  2. site is using https as required

Yet login widget is not showing up. Why it could be?

I redeployed it few times, checked various settings from there https://core.telegram.org/widgets/login to no avail

答案1

得分: 0

It seems like you have put the <script> tag inside the <head>. Put it somewhere inside the <body>, so it can be displayed when the button component is created.

<body>
    <div class="content">
        <!-- your app -->
        <!-- the script tag provided by Telegram wherever you want the button to be -->
    </div>
</body>
英文:

It seems like you have put the &lt;script&gt; tag inside the &lt;head&gt;. Put it somewhere inside the &lt;body&gt;, so it can be displayed when the button component is created.

&lt;body&gt;
    &lt;div class=&quot;content&quot;&gt;
        &lt;!-- your app --&gt;
        &lt;!-- the script tag provided by Telegram wherever you want the button to be ---&gt;
    &lt;/div&gt;
&lt;/body&gt;

huangapple
  • 本文由 发表于 2023年7月27日 21:09:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76780084.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定