I have below html codes
inside of map. how can i capture the json.ip into html ip= json.ip?
I am actually able to get the public ip. Just try to put the ip value into html
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title></title>
<!-- START: Here's the IP stuff -->
<script type="application/javascri
pt">
function getIP(json) {
alert("My public IP address is: " + json.ip);
}
</script>
<script type="application/javascri
pt"
src="
http://api.ipify.org?format=jsonp&callback=getIP">
</script>
<!-- END: IP Stuff -->
</head>
<body>
<form id="form1">
<div>
<map name="planetmap">
<area shape="rect" coords="0,388 185,429" alt="Chino, CA" target="_blank" href="
http://www.gdfg.biz/ClickRecoder.aspx?rentalLocation=SMC-Chino&URL=http://www.sharsdfgfd.com?ip=">
</map>
</div>
</form>
</body>
</html>
Open in new window
You should not need to call getIP, it looks like it is a callback and so api.ipify.org will call it.