如何使用maxmind javascript获取信息的ip

如何使用maxmind javascript获取信息的ip,javascript,php,maxmind,Javascript,Php,Maxmind,我想用maxmind javascript获取用户的ip、位置、城市、国家等,但我得到了空值 我有什么错误吗 我还有一个问题,我可以把maxmind javascript放到我的插件中无限使用吗 我的javascript在这里: <script src="http://j.maxmind.com/app/geoip.js"></script> <script> $("#country").html(document.write(geoip_countr

我想用maxmind javascript获取用户的ip、位置、城市、国家等,但我得到了空值 我有什么错误吗

我还有一个问题,我可以把maxmind javascript放到我的插件中无限使用吗

我的javascript在这里:

<script src="http://j.maxmind.com/app/geoip.js"></script>
<script>
    $("#country").html(document.write(geoip_country_code()));
    $("#countryname").html(document.write(geoip_country_name()));
    $("#city").html(document.write(geoip_city()));
    $("#region").html(document.write(geoip_region()));
    $("#regionname").html(document.write(geoip_region_name()));
</script>

$(“#country”).html(document.write(geoip#u country_code());
$(“#countryname”).html(document.write(geoip#u country_name());
$(“#city”).html(document.write(geoip#u city());
$(“#region”).html(document.write(geoip#u region());
$(“#regionname”).html(document.write(geoip#u region_name());
HTML此处

<div id="country">&nbsp;</div>
<div id="countryname">&nbsp;</div>
<div id="city">&nbsp;</div>
<div id="region">&nbsp;</div>
<div id="regionname">&nbsp;</div> 

为什么要使用
文档。在jQuery命令中写入
?以下命令正确输出我的位置。根据使用限制,你必须阅读

$(“#country”).html('country:'+geoip#u country_code());
$(“#countryname”).html('Country name:'+geoip#u Country_name());
$(“#city”).html('city:'+geoip#u city());
$(“#region”).html('region:'+geoip#u region());
$(“#regionname”).html('Region name:'+geoip#u Region_name())
div:n个类型(奇数){
背景:#e0;
}
div:n个类型(偶数){
背景#a5a5;
}
div{
填充物:5px;
保证金:5px;
}


working thanx:)但如果我使用maxmind的js来访问我的网站,每天会有50000个印象。。。。它是免费的吗??对于用户?我不知道,他们的页面上说你必须付费。哦,我真的看到了,每天5万英镑!,我怀疑你会搭便车;)是的,我不知道这个js是如何工作的,但如果我在我的高流量网站上使用它:(不知道收费)