【发布时间】:2017-12-23 21:57:27
【问题描述】:
我正在创建一个与 Trello API 交互的 javascript 文件,但是当我运行该文件时,它在 Chrome 开发工具中是这样说的:
GET http://localhost:8080/js/trello.js net::ERR_ABORTED
GET http://localhost:8080/js/trello.js 404 (Not Found)
trello.js 肯定在 /js 中,我只尝试过 /trello.js 但似乎没有任何效果。有人可以帮助新手吗?我正在使用带有 Python 和 webapp2 的 Google App Engine。
HTML
<html>
<head>
<title>Admin Page</title>
</head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://api.trello.com/1/client.js?key={APIKey}"></script>
<script type="text/javascript" src="js/trello.js"></script>
<body>
{% if admin %}
<p>All Work Requests</p>
<a href="{{ logout_url }}">log out</a><br>
<a href="trello.js">Trello test</a>
{% for result in results %}
<table>
<tr>
<th><b>{{ result.email }}</th>
<th><b> {{ result.date }}</th>
<th><b> {{ result.title }}</th>
<th><b> {{ result.key.id() }}</th>
<th><a href="/delete/{{ result.key.id() }}">Delete</a></th>
<th><a href="/assign/{{ result.key.id() }}">Assign</a></th>
</tr>
</table>
{% endfor %}
<p>{{ result }}</p>
{% else %}
<p>Welcome please <a href="{{ login_url }}">login...</a>
<p>Not admin</p>
{% endif %}
</body>
</html>
trello.js
var authenticationSuccess = function() {
console.log('Successful authentication');
};
var authenticationFailure = function() {
console.log('Failed authentication');
};
window.Trello.authorize({
type: 'popup',
name: 'Getting Started Application',
scope: {
read: 'true',
write: 'true' },
expiration: 'never',
success: authenticationSuccess,
error: authenticationFailure
});
var myList = 'removed';
var creationSuccess = function (data) {
console.log('Card created successfully.');
console.log(JSON.stringify(data, null, 2));
};
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'
};
window.Trello.post('/cards/', newCard, creationSuccess);
//window.Trello.put('/cards/[ID]', {name: 'New Test Card'});
【问题讨论】:
-
快速猜测:
Trello.js与trello.js? -
不,很遗憾,我将编辑我的帖子说 trello.js
-
好吧本来很容易:D
-
Idk Google 应用引擎,但我认为有一些公用文件夹?您的 js 文件夹应该在其中。如果没有公用文件夹或者它已经存在,我担心我们需要等待专家。
-
你可能是对的,我会读一读。谢谢。
标签: javascript python google-app-engine