0
球員我想知道你是否看到任何有關此代碼的內容會導致無限重定向。我無法弄清楚。這是使用正確加載的GeoIP2 API。由腳本導致的無限重定向
var redirect = (function() {
var onSuccess = function (geoipResponse) {
var sites = {
"cn": true
};
if (!geoipResponse.country.iso_code) {
window.location.replace("http://gotriplec.com/");
}
var code = geoipResponse.country.iso_code.toLowerCase();
if (sites[code]) {
alert("Your IP cannot access this website... We apologize for any inconvenience caused.");
window.location.replace("http://www.google.com");
}
else {
window.location.replace("http://gotriplec.com/");
}
};
var onError = function (error) {
window.location.replace("http://gotriplec.com/");
};
return function() {
geoip2.country(onSuccess, onError);
};
}());
Ahhh我通過閱讀您的消息來看問題。每個登錄名都有window.location.replace。如果我只留下適當的重定向,它應該工作.... – 2014-10-10 03:19:38