GET方法无法返回资源

时间:2014-02-09 16:35:45

标签: javascript http http-headers xmlhttprequest wamp

我正在WAMP中托管一个网页,并继续在Chrome Developer Console

中收到此错误

GET http://localhost/surveys/Internet.json survey.js:368

我的survey.js第368行在此函数中

function loadJSON(key,json){

    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function(){
        if (xhr.readyState === 4) {
            if (xhr.status === 200) {
                var obj = xhr.responseText;
                localStorage.setItem(key,obj);
            } 
        }
        };
    xhr.open("GET", json, true);
    xhr.send(); // <<-------------------------- line 368    

}

我不知道发生了什么事。我最近尝试重新安装wamp希望它只是与另一个应用程序的冲突,但它没有解决任何问题。 任何帮助都会很棒。

1 个答案:

答案 0 :(得分:0)

这是CACHE MANIFEST文件中的问题 必须在清单中注意这些文件需要互联网连接才能使用,在我的情况下我没有。

CACHE MANIFEST
#Files to store on application cache

NETWORK
#Files that would require internet connection to access