我想做的是根据国家代码和下面的脚本重定向国家。下面的代码不起作用。做一些研究我发现我必须使用 or 语句,或者至少这是我认为我需要的,但我的问题是有比 or 语句更简单的方法吗?如您所见,我正在检查很多国家/地区。
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var country= geoip_country_code();
if(country = "UK","CA","DE","DK","FR","AU","SE","CH","NL","IT","BE","AT","ES","NO","IE","FI","GB","US")
{
window.location.href='http://www.google.com';
}
else
{
window.location.href='http://www.yahoo.com';
}
</script>