не работает код в уроке javascript/ajax
Access to XMLHttpRequest at 'file:///C:/Users/User/Desktop/it/js/JSON/currency.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.
json.html:44 The specified value "wrong" cannot be parsed, or is out of range.
GET file:///C:/Users/User/Desktop/it/js/JSON/currency.json net::ERR_FAILED
это мой код и выдает такие ошибки;
let inputRub=document.getElementById("rub"),
inputUsd=document.getElementById("usd");
inputRub.addEventListener('input',()=>{
let request=new XMLHttpRequest();
request.open('GET','currency.json');
request.setRequestHeader('Content-type','application/json;charset=utf-8');
request.send();
request.addEventListener('readystatechange',function () {
if(request.readyState===4 && request.status==200){
let data=JSON.parse(request.response);
inputUsd.value=inputRub.value/data.usd;
}
else{
inputUsd.value="wrong";
}
});
});