This is my code im not the most experienced in javascript.
var x = document.domain;
function myFunction() {
if(x == "usa"){
window.location = "usafile"
}
elseif(x == "canada"){
window.location = "canadafile"
}
}
This is my code im not the most experienced in javascript.
var x = document.domain;
function myFunction() {
if(x == "usa"){
window.location = "usafile"
}
elseif(x == "canada"){
window.location = "canadafile"
}
}
You can look their ip up in any ip to location service (hostip.info, maxmind). This will be accurate most of the time.
Check this answer: How to get visitor's location (i.e. country) using javascript geolocation