0
jQuery.getJSON('https://j.maxmind.com/app/geoip.js', function() {
var country = geoip_country_code();
var city = geoip_city();
if (city == 'Ashburn' || city == 'Palo Alto' || city == 'Menlo Park' || country == 'IN')
{
window.top.location = "https://www.google.com/";
} else if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
} else {
top.location.href = 'xxxxxxxxxxxx';
}
});
我想根據用戶重定向。正如你在代碼中看到的,但它不工作。根據條件重定向
首先檢查用戶是來自哪個城市或國家,然後檢查用戶是來自移動設備還是桌面並重定向。
你使用的瀏覽器不能正常工作window.location.href – user3304678
@ user3304678?移動或桌面。給出完整的細節,哪些不起作用? –