10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 13:13:55 +01:00

Fix bugs introduced in the last two commit

This commit is contained in:
Mickaël Véril 2019-09-05 11:31:38 +02:00
parent 9b1a445998
commit 01f2e6734b
2 changed files with 12 additions and 10 deletions

View File

@ -17,7 +17,7 @@
var file=filename+'.dat'; var file=filename+'.dat';
var lnk_file=document.getElementById('lnk_file'); var lnk_file=document.getElementById('lnk_file');
lnk_file.setAttribute('href',getFullDataPath(file)); lnk_file.setAttribute('href',getFullDataPath(file));
dat= await data.loadAsnyc(file); dat= await data.loadAsync(file);
await applyData(dat); await applyData(dat);
} }
async function applyData(dat) { async function applyData(dat) {
@ -71,7 +71,7 @@
</script> </script>
<label>Write a data file name without extension<br/> <label>Write a data file name without extension<br/>
<input type="text" id='inp_filename' onkeydown="onKeyDown(e)"></input> <input type="text" id='inp_filename' onkeydown="onKeyDown(event)"></input>
</label><br/> </label><br/>
<p id=data_par></p> <p id=data_par></p>
<a target="_blank" id='lnk_file' type='text/plain'>Go to file</a> <a target="_blank" id='lnk_file' type='text/plain'>Go to file</a>

View File

@ -75,16 +75,18 @@ class data {
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open("GET",getFullDataPath(file), true); req.open("GET",getFullDataPath(file), true);
req.onreadystatechange = function() { req.onreadystatechange = function() {
if (req.readyState == 4 && req.status == 200) {//when a good response is given do this if (req.readyState == 4) {
if (req.status == 200) {//when a good response is given do this
var text = req.responseText; var text = req.responseText;
resolve(data.loadString(text)) resolve(data.loadString(text));
} else { } else {
reject({ reject({
status: req.status, status: req.status,
statusText: req.statusText statusText: req.statusText
}); });
} }
}; }
}
req.send(); req.send();
}); });
} }