fetch('https://api.country.is/')
.then(function(response) {
return response.json();
})
.then(function(data) {
if(data.country == 'TR') {
window.location.replace("trlink");
}else if(data.country == 'US') {
window.location.replace("uslink");
}else if(data.country == 'UK') {
window.location.replace("uklink");
}else if(data.country == 'CA') {
window.location.replace("calink");
}else{
window.location.replace("defaultlink");
}
}); fetch('https://api.country.is/')
.then(function(response) {
return response.json();
})
.then(function(data) {
switch (data.country) {
case 'TR':
window.location.replace("http://tr.com");
break;
case 'US':
window.location.replace("http://en.com");
break;
default:
window.location.replace("http://standart.com");
}
});
İkisini de deneyeceğim muhtemelen çalışıyordur teşekkürler