DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Javascript Jumps To Language

10.02.2006
| 396 views |
  • submit to reddit
        // use navigator-object to find browser language
// forward to start page with the same language

<html><head><title>laguage jump</title></head><body>

<script type="text/javascript">

if (navigator.language.indexOf("en") > -1) {
  window.location.href = "index_en.html";
}else if (navigator.language.indexOf("de") > -1) {
  window.location.href = "index_de.html";
} else {
  window.location.href = "index_default.html";
}

</script>