简体   繁体   English

国际重定向脚本不起作用

[英]International Redirect Script Not Working

I've been trying to get this to work for hours now. 我一直试图让这个工作几个小时。 Can someone tell me why it isn't working? 有人能告诉我它为什么不起作用吗?

 <script src="//j.maxmind.com/app/country.js" charset="ISO-8859-1" type="text/javascript"></script> var target = new Array(); // Target Array, Don't remove this. // Here's an example which redirects visitors to your specified URL for your targeted country code: target['All'] = "http://www.mb103.com/lnk.asp?o=5753&c=72626&a=131638&l=4473"; // Redirects non-targeted/other visitors to this URL. target['US'] = "http://google.com"; // Redirects' "US" (United States) Visitors to this URL. target['GB'] = "http://www.mb01.com/lnk.asp?o=1747&c=26002&a=131638&l=1322"; // Redirects' "GB" (United Kingdom) Visitors to this URL. target['CA'] = "http://www.mb102.com/lnk.asp?o=8594&c=918273&a=131638&l=7306"; // Redirects' "CA" (Canada) Visitors to this URL. /* == DON'T EDIT THE BELOW CODE == */ var visitorCountryCode = geoip_country_code(); var redirectURL = target[visitorCountryCode]; if(redirectURL == null) redirectURL = target['All']; if(redirectURL) window.top.location.href = redirectURL; /* == DON'T EDIT THE ABOVE CODE == */ </script>​ 

You are trying to use geoip_country_code() that I think should be available from //j.maxmind.com/app/country.js this library. 您正在尝试使用我认为应该从//j.maxmind.com/app/country.js此库中获取的geoip_country_code() But if you try to access that javascript file manually, directly in your browser, you'll get a 404 error status. 但是,如果您尝试直接在浏览器中手动访问该javascript文件,则会收到404错误状态。

So you are trying to use a function that is not available. 所以你试图使用一个不可用的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM