GEO DIV, So fügen Sie sonst zeigen {# other-Land},
Helfen Sie mir hinzuzufügen, bitte .......
ausblenden CN und HK, wenn die ip andere ist geo div wie sonst show # andere Land
<html>
<head>
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
<style>
#CN {
text-align: left;
color: blue;
display: none;
}
#HK {
text-align: left;
color: blue;
display: none;
}
#country_code {
text-align: left;
color: blue;
display: none;
}
</style>
</head>
<body>
<div id="HK">Hello HK</div>
<div id="CN">hello China</div>
<div id="other-country">Hello Other country</div>
<script>
$.get("http://freegeoip.net/json/", function(response) {
$("#country_code").html(response.country_code);
if (response.country_code == 'HK' || response.country_code == 'CN') {
document.getElementById(response.country_code).style.display = "block";
}
}
, "jsonp");
</script>
</body>
</html>
andere quenstion,
kann dies steckt es in meinem eigenen Server?
http://freegeoip.net/json/