You are here: Re: Showing script based on the country « HTML « IT news, forums, messages
Re: Showing script based on the country

Posted by jojo on 07/05/06 23:06

Nospam schrieb:
> I have a few javascripts. I would like to show a certain script based on
> the country ip of the viewer, how would I achieve this? is there html I
> could use to run the javascript based on the country ip?
>
>

Another solution would be to write everything in one script but call
different functions according to the language. The advantage would be
that you can use JS to get the language selected in the browser:

var lang;
if (navigator.browserLanguage) lang=navigator.browserLanguage; //IE
else if (navigator.language) lang=navigator.language; //others

or, shortend:

var lang=(navigator.browserLanguage) ? navigator.browserLanguage :
navigator.language;

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация