服务静态文件谷歌应用程序引擎,Ajax失败

时间:2017-09-27 22:28:28

标签: ajax google-app-engine

我是GAE的新手,我无法理解这一点,所以请你帮忙,我的应用程序中有以下文件夹树:
static --images ---subImages --index.html
我正在使用Ajax获取subImages文件夹的内容,如下所示:

$.ajax({
        url: folder,
        success: function (data) {
            $(data).find("a").attr("href", function (i, val) {
                if (val.match(/\.jpg|\.png|\.gif/)) {
                    $("#gallery").append("<img src='" + folder + val + "'" + " data-image='" + folder + val + "'" + ">");
                }
            });
        }
    });  

我收到404错误 我的YAML文件来自:https://gist.github.com/darktable/873098

1 个答案:

答案 0 :(得分:0)

var employees = [{ "firstName": "Von", "lastName": "Budibent", "email": "vbudibent0@163.com", "department": "Sales" }, { "firstName": "Catherina", "lastName": "Swalowe", "email": "cswalowe1@example.com", "department": "Engineering" }, { "firstName": "Theo", "lastName": "Trill", "email": "ttrill2@sina.com.cn", "department": "Services" }, { "firstName": "Elsy", "lastName": "McCrorie", "email": "emccrorie3@netscape.com", "department": "Legal" }, { "firstName": "Lorie", "lastName": "Handsheart", "email": "lhandsheart4@fotki.com", "department": "Research and Development" }]; var editedEmployees = employees .filter(emp => emp.firstName !== 'Theo') .map(emp => ({ "firstName": emp.firstName, "lastName": emp.lastName, "email": emp.email, "department": emp.firstName === 'Lorie' ? 'HR' : emp.department })); console.log(editedEmployees)和您链接的信息确实已过时。它加载app.yaml,这是Python 2.5并且已被弃用。它也有其他问题。

您可能应该遵循Hosting a static website on App Engine上的官方教程。您可能最终得到runtime: python,如下所示:

app.yaml