这是我的代码,但它不起作用。检测国家和重定向
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="http://api.wipmania.com/jsonp?callback.js"></script>
<script type="text/javascript">
switch(country_code()){
case "IN" :
document.location.href = "http://xxxxxxxx.biz/theme.php";
break;
}
</script>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</html>
我想检测用户的国家,并适当地重定向他们。
无法正常工作。请任何例子。 – user3304678
比可能意味着很多事情的“不工作”更具描述性,您是否收到错误? http://jsfiddle.net/LYJtP/这个小提琴显示它的工作 –
现在工作:)谢谢 – user3304678