我正在尝试演示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,什么都没有发生。弹出窗口没有关闭。
任何帮助,将不胜感激。
下载the code here
最佳答案
在尝试通过按钮运行ConnectToTrello函数之前,我遇到了同样的问题。如果您创建一个简单页面,并在<script>
块中执行该javascript代码段,则该页面会显示您描述的行为。
但是,如果您添加一个具有该功能的简单按钮作为onclick事件处理程序,则它可以正常工作。
<button onclick="ConnectToTrello();">press me!</button>
关于javascript - Trello API身份验证弹出窗口未关闭,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34432025/