Edwin Rodríguez

Redirecting page by location with javascript


Here is the code

<!DOCTYPE html>
<html>
<head>
<title>Wikipedia redirect</title>
<script>
var language = navigator.language || navigator.browserLanguage;
if ( language.substr(0,2) == 'es' ) window.location = "http://es.wikipedia.org"; 
else window.location = "http://en.wikipedia.org";
</script>
</head>
<body>
</body>
</html>

2017 - Edwin Rodríguez