请考虑让我拥有一个html页面..
我想向非印度(IN)用户显示该页面,并向其他国家/地区的用户显示该页面...
请任何人帮助我提供完整的工作代码....
答案 0 :(得分:0)
您可以使用此
$.get("https://ipinfo.io", function(response) {
console.log(response.city, response.country);
if(response.country == 'KR'){
//handle your logic here
alert('You can not see this content');
//window.location.href = '/yourlink';
}
}, "jsonp");
$.get("https://ipinfo.io", function(response) {
console.log(response.city, response.country);
if(response.country == 'KR'){
//handle your logic here
alert('You can not see this content');
//window.location.href = '/yourlink';
}
}, "jsonp");
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>