Code:<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('en') > -1) document.location.href = 'english.html';
else if (language.indexOf('de') > -1) document.location.href = 'german.html';
else if (language.indexOf('it') > -1) document.location.href = 'italian.html';
else
document.location.href = 'defaultpage.html';
// End -->
</script>
If the script doesn't work across browsers that may be due to different JavaScript implementations, and it may not be possible to read local language settings with JavaScript in some browsers.
I got it, thanks dude, this will be a good solution then, cause the company i work for don't want to use PHP, they use ASP, and this sucks, the problem is that i'm good programming in Asp.net, i can read, but not code.
0 Replies
HTMLconfused
1
Reply
Fri 4 Jun, 2010 06:30 am
I have no programing expirience and have use MS Front page to creat a web site for our small company. We do business in English and French so I have two different web sites. We have a home page that has an English or French selector butone, but over 50% of customers bounce out of that page. I would like to eliminate it. Do I just copy this code into the HTML of that first page and change the It for Fr. How does the code tell the incoming browser which page to go to? Do you not need to add an adress like, HTTP//www.sumthing//forexample?