{{oauth_token}}在源代码中显示并工作,但不在页面上

{{ oauth_token }} shows up and works in source but not on the page

本文关键字:工作 显示 oauth token 源代码      更新时间:2023-09-26

我已经编写了一个视图来生成oauth_token,通过模板语法嵌入到链接中以生成授权url。当我点击页面上的链接时,地址缺少oauth_token。然而,当我点击源代码中的链接时,它运行得非常好,并将我带到授权页面。

这里发生了什么?

这是我的模板语法链接:

<a href="https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token={{ request_token }}" onclick="javascript:void window.open('http://https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=','1377808978328','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;">Or use scoring and settings from your yahoo league!</a>

以下是来源中的链接:

<a href="https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=q2sasyz" onclick="javascript:void window.open('http://https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=','1377808978328','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;">Or use scoring and settings from your yahoo league!</a>

只是重申一下,当我点击源链接时,我会到达我需要去的地方,但当我点击页面的链接时,会收到来自chrome的消息,说:

Oops! Google Chrome could not find httpsDid you mean: https:­/­/­api.­login.­yahoo.­com/­oauth/­v2/­request_auth

感谢收看

您在a标记的onclick部分出现错误,请参阅url以http://https::开头

http://https://api.login.yahoo.com/oauth/v2/request_auth?oauth_token=

如果单击页面上的链接,则执行onclick()。如果您正在单击页面源中的链接,则使用href,并且该链接有效。