Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/01/2002, 22:48
Insy
 
Fecha de Ingreso: enero-2002
Ubicación: Canarias
Mensajes: 59
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: como detecto pais e idioma

Este código te redirecciona a una página según la configuración del navegador, aunque sería mas interesante alguna forma de hacerlo según la IP del usuario.

<SCRIPT LANGUAGE="JavaScript1.2">
<!-- inicio
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

if (language.indexOf('en') > -1) document.location.href = 'ingles.html';
else if (language.indexOf('nl') > -1) document.location.href = 'holandes.html';
else if (language.indexOf('fr') > -1) document.location.href = 'frances.html';
else if (language.indexOf('de') > -1) document.location.href = 'aleman.html';
else if (language.indexOf('ja') > -1) document.location.href = 'japones.html';
else if (language.indexOf('it') > -1) document.location.href = 'italiano.html';
else if (language.indexOf('pt') > -1) document.location.href = 'portugues.html';
else if (language.indexOf('es') > -1) document.location.href = 'espanol.html';
else if (language.indexOf('sv') > -1) document.location.href = 'suizo.html';
else if (language.indexOf('zh') > -1) document.location.href = 'chino.html';
else
document.location.href = 'ingles.html';
// fin -->
</script>