【发布时间】:2013-10-23 17:47:19
【问题描述】:
我有一个 joomla 2.5 双语网站,我在 index.php 中有以下代码
<script type="text/javascript"> // <![CDATA[
if ( (navigator.userAgent.indexOf('Android') != -1) ) {
document.location = "a.html";
} // ]]>
</script>
因此,如果您从 Android 手机/平板电脑登录,它将引导您访问 a.html 链接。
我想做的是:
假设网站的网址是 www.test.com/index.php?lang=en 所以当您从 android 登录时,它会引导您访问 a.html当您从 www.test.com/index.php 登录时?lang=fr 应该 引导您进入 b.html 。 p>
我需要根据语言进行区分。
提前致谢。
【问题讨论】:
-
最好使用重定向服务器端(即使用标头)而不是使用 javascript
-
Oriol> 对不起,伙计,没有看到你的消息。使用标题是什么意思?