cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.07k stars 902 forks source link

preloadTextFileData pointing to _fileDataCache #1074

Closed pekayatt closed 11 years ago

pekayatt commented 11 years ago

at line 281 of CCFileUtils.js

else {
            if (xhr.overrideMimeType)
                xhr.overrideMimeType("text\/plain; charset=utf-8");
            xhr.onload = function (e) {
                if (xhr.responseText) {
                    cc.Loader.getInstance().onResLoaded();
                    selfPointer._textFileCache[fileUrl] = xhr.responseText;
                }
            };
}

instead of

else {
            if (xhr.overrideMimeType)
                xhr.overrideMimeType("text\/plain; charset=utf-8");
            xhr.onload = function (e) {
                if (xhr.responseText) {
                    cc.Loader.getInstance().onResLoaded();
                    selfPointer._fileDataCache[fileUrl] = xhr.responseText;
                }
            };
}
dingpinglv commented 11 years ago

It has been fixed at https://github.com/xingsenma/cocos2d-html5/commit/0e6f84632cb27610f16519a3308fba05a40c147c

Thank you.