获取ip地理地址的接口
gridview中有一列ip地理地址,和ip列,通过ip找个获取ip地址的接口然后给ip地理地址那列绑定上,找个新浪的接口
<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=202.108.22.5 "></script>
<script type="text/javascript">
document.write(remote_ip_info.country + "," + remote_ip_info.province);
alert(remote_ip_info.country);
</script>
我怎么把
<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=202.108.22.5 "></script>
中的ip换成我从gridview中获取到的ip
[解决办法]
http://www.oschina.net/question/574208_122713
[解决办法]
document.write('<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=' + getIP + '"><\/script>');
[解决办法]
类似这样:
<SCRIPT type="text/javascript">
function getip {
.........
return ip
}
document.write'<script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=' + getIP + '"><\/script>');
</SCRIPT>