gpt4 book ai didi

javascript - Trello API 发布新卡错误 - 无法在 'postMessage' 上执行 'DOMWindow'

转载 作者:行者123 更新时间:2023-11-27 22:43:32 26 4
gpt4 key购买 nike

我正在尝试按照教程在我的 Trello 看板列表中创建一张新卡。

我从这里获取 key https://trello.com/app-key按照本教程 https://developers.trello.com/get-started/start-building我在单独的选项卡中打开了我的板。并尝试了公共(public)和私有(private)模式。

但是,我得到

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('file://') does not match the recipient window's origin ('null').

可能是什么问题?

这是我的代码:

  <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>

<script src="https://api.trello.com/1/client.js?key=MyKey"></script>



<body>
<script>




var authenticationSuccess = function() { console.log('Successful authentication'); };
var authenticationFailure = function() { console.log('Failed authentication'); };


Trello.authorize({
type: 'popup',
name: 'Getting Started Application',
scope: {
read: true,
write: true },
expiration: 'never',
success: authenticationSuccess,
error: authenticationFailure
});

var myList = 'Mylist';
var creationSuccess = function(data) {
console.log('Card created successfully. Data returned:' + JSON.stringify(data));
};

var newCard = {
name: 'New Test Card',
desc: 'This is the description of our new card.',
// Place this card at the top of our list
idList: myList,
pos: 'top'
};

Trello.post('/cards/', newCard, creationSuccess);

</script>

最佳答案

我解决了这个问题。您必须从服务器而不是本地文件系统执行它。就这么简单。

关于javascript - Trello API 发布新卡错误 - 无法在 'postMessage' 上执行 'DOMWindow',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38592186/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com