我正在尝试演示 Trello API,但我遇到了身份验证过程的问题。
var ConnectToTrello = function () {
//console.log("Authenticating");
Trello.authorize({
type: 'popup',
name: 'Outlook Trello Add-In',
scope: { read: true, write: true, account: true },
success: authenticationSuccess,
error: authenticationError
});};
这会打开一个弹出窗口,我可以在其中进行身份验证,然后我被重定向(在弹出窗口中)到 https://trello.com/1/token/approve 什么也没发生。弹出窗口没有关闭。
如有任何帮助,我们将不胜感激。
最佳答案
在尝试从按钮运行 ConnectToTrello 功能之前,我遇到了同样的问题。如果您创建一个简单的页面,并在 <script>
中执行该 javascript 片段阻止它表现出您描述的行为。
但是,如果您添加一个具有该功能的简单按钮作为 onclick 事件处理程序,那么它就可以正常工作。
<button onclick="ConnectToTrello();">press me!</button>
关于javascript - Trello API 身份验证弹出窗口未关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34432025/