2013-08-29 48 views
2

我写了一个视图来生成一个oauth_token,通过模板语法将其嵌入链接以生成授权url。当我点击页面上的链接时,地址缺少oauth_token。但是,当我点击源代码中的链接时,它工作得很好,并将我带到授权页面。{{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> 

只是重申当我点击来源链接我去上我需要去,但当我点击页面的链接,我收到一条消息,从铬说:

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

感谢观看

回答

3

你必须在a标签的onclick部分的错误,请参阅网址开头http://https:

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

如果你点击页面上的链接,onclick()是执行。如果您点击页面源中的链接 - 使用了href且链接有效。

+0

好抓!另外,正如我注意到的,当我在第二个链接之后放置标记时,它也会到达我想要的位置。感谢您的帮助 –

相关问题