Alguem poderia me ajudar? esta dando esse erro e não sei o que é , sempre da erro no send
function SortEmployees() {
var xmlhttp = new XMLHttpRequest();
var myArr = new Object();
xmlhttp.open("GET", "js/Trainning/JS4_list.json", true);
xmlhttp.onreadystatechange = function (myArr) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myArr = JSON.parse(xmlhttp.responseText);
Sort(myArr);
}
};
xmlhttp.send();
return myArr;
}
erro: JS4_SortEmployees.js:16 Access to XMLHttpRequest at 'file:///C:/Users/pazevedo/Desktop/Trainning/Trainning/JavaScript/TrainningPage/js/Trainning/JS4_list.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.