axios.get('https://timeapi.io/api/Time/current/zone?timeZone=Africa/Tripoli')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
});
حاولت جلب الوقت الحالي لكن يظهر خطأ
Access to XMLHttpRequest at 'https://timeapi.io/api/Time/current/zone?timeZone=Africa/Tripoli'
from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.