|
Blue Forest http://www.lslnet.com at 6:28 p.m. on August 22, 2006
"Jump practiced judgment browser language," once again ask -
A judge cited the following methods to achieve language browser practiced goto,
But here is jumping 'chinese.htm' 'swedish.htm'. . . Other pages.
After still can goto "index.htm" of this document?
If I were to say the Chinese browser, visit www.abcd.com, but only in the IE address shown http:www.abcd.com/
But when I use the English browser, visit www.abcd.com, and the last column shows only in IE address http:www.abcd.com/
Can be achieved? ?
Thank you
_________ Following is the above-mentioned methods -----------------
Detection browser languages, the site is suitable for multi-language versions
Unknown : 668 hits 2003-04-25
Detection browser languages, the site is suitable for multi-language versions
If you are facing around the world to surf the web site, or for carrying out business activities to detect visitors on the browser type of language is very realistic. Revealed here can be detected in the script; The language browser types can be identified in Chinese as "ZH", the English version can be identified as "EN" and then under the swift judgment
Different types of language-oriented language version of the page. Of course, you can solve this problem through the server to the client using this script on it.
You need to code HTML on the "head are area. Different language versions of the pages can be done then.
"SCRIPT LANGUAGE=" javascript1.2 ""
<!--//
If (navigator.appName ====== 'Netscape')
Var = navigator.language; language
Else
Var = navigator.browserLanguage; language
If (language.indexOf ( 'en'), "-1) document.location.href = 'english.htm';
Else if (language.indexOf ( 'nl'), "-1) document.location.href = 'dutch.htm';
Else if (language.indexOf ( 'subresonance'), "-1) document.location.href = 'french.htm';
Else if (language.indexOf ( 'de'), "-1) document.location.href = 'german.htm';
Else if (language.indexOf ( 'ja'), "-1) document.location.href = 'japanese.htm';
Else if (language.indexOf ( 'it'), "-1) document.location.href = 'italian.htm';
Else if (language.indexOf ( 'pt'), "-1) document.location.href = 'portuguese.htm';
Else if (language.indexOf ( 'es'), "-1) document.location.href =' Spanish.htm ';
Else if (language.indexOf ( 'sv'), "-1) document.location.href = 'swedish.htm';
Else if (language.indexOf ( 'zh'), "-1) document.location.href = 'chinese.htm';
Else
Document.location.href = 'english.htm';
4003rd End Guangzhou Trade Fair
"/script> |
Could not hear clearly.
If the browser is the Chinese dialect of Chinese that jump page.
If the browser is the language, it also jump to the corresponding page in English.
But you would index.htm, say you want to show that the framework of the two-page? |
No, not to use framework
I think this :
Passed judgment browser, we realize different shows in different languages,
But in the IE column, or does he want to show with a web site address, such as : www.abc.com
I know that framework can be used to achieve this, but there is no alternative framework can be achieved? |
Cause; of course, direct loading of the page judgment first language, and then use document.write () method included. |
But if a large amount of time to visit with each document.wrote () will write the words than not document.wrote () into slower?
|
[html]
"Script>
Aa= "" Differences color=red> here is Chinese - "reality";
Bb= "" Differences color=red>This is an English Web Site</font> ";
If (/zh/.test (navigator.browserLanguage)) (
Document.write (aa);
}
Else{
Document.write (bb);
}
"/script>
[/html] |
Should not bar, there is a hidden layer of the display and use display:none not occupy a space, but the memory |
When the type of "aa" and "bb" is a relatively large pages of time?
And if in addition to "aa" and "bb" there "cc", "dd." . . . . (For example, more than 10 pages in the languages) time? This method will increase the burden on the server and flow? |
Visit before the first page of Google interface but shows that only addresses column "www.google.com"
Jump to this day Google is the address : "http://www.google.com/intl/zh-CN/"
I really do not know how they used to be a kind of realization - Oh |
Using document.write () should not, but with several countries bore little relation to the number of pages,
When the browser judgment, judgment for the Chinese as a true before calling document.write () wrote,
The other, of course, is false myself, and the operation does not exist any. |
Thank you, uh 呵~~ good yexj00 help ~ ~ ~ ~ ~ ~ Thank you :) |
|