Я стараюсь следовать учебному пособию и создавать новую карточку в своем списке платформ Trello.Trello API Ошибка новой публикации карты - Не удалось выполнить 'postMessage' в 'DOMWindow'
Я получаю свой ключ здесь https://trello.com/app-key После этого урока https://developers.trello.com/get-started/start-building У меня есть доска открыта в отдельной вкладке. И попробовал как публичный, так и частный режим.
Однако я получаю
Не удалось выполнить «PostMessage» на «DOMWindow»: Мишень происхождения при условии («файл: //») не соответствует происхождения ('нуль окна получателя «).
В чем может быть проблема?
Это мой код:
<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>