diff --git a/js/script.js b/js/script.js index e2df85492215485750b78f87e3ce2aeed7f138f4..d42624fa148790eb789277c2d0020bfdf3b7831a 100644 --- a/js/script.js +++ b/js/script.js @@ -46,10 +46,11 @@ var loadFile = function (category, algorithm, file, explanation) { dataEditor.setValue(cachedFile[dir].data, -1); codeEditor.setValue(cachedFile[dir].code, -1); } else { + cachedFile[dir] = {}; dataEditor.setValue(''); codeEditor.setValue(''); $.get(dir + 'data.js', function (data) { - cachedFile[dir] = {data: data}; + cachedFile[dir].data = data; dataEditor.setValue(data, -1); $.get(dir + 'code.js', function (code) {