I have a javascript function to read files that are inside the server. In all browsers it works perfectly, except for firefox that returns the error:
SyntaxError: missing; before statement
Function code:
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function lerArquivo(arquivo) {
var response;
jQuery.get(arquivo, function(data) {
response = data;
}, 'text');
await sleep(500);
return response;
}