Maxming Geo Location Code Not Working

This Maxmind Code is not working:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
</head>

<body>
<br>Country Code:
<script language="JavaScript">document.write(geoip_country_code());</script>
<br>Country Name:
<script language="JavaScript">document.write(geoip_country_name());</script>
<br>City:
<script language="JavaScript">document.write(geoip_city());</script>
<br>Region:
<script language="JavaScript">document.write(geoip_region());</script>
<br>Region Name:
<script language="JavaScript">document.write(geoip_region_name());</script>
<br>Latitude:
<script language="JavaScript">document.write(geoip_latitude());</script>
<br>Longitude:
<script language="JavaScript">document.write(geoip_longitude());</script>
<br>Postal Code:
<script language="JavaScript">document.write(geoip_postal_code());</script>
</body>
</html>

Please tell me the perfect code.

It is very essential for me.

Did you contact maxmind ?

Personally I would be very reluctant to use document.write old and problematic.

1 Like

Asking for the solution like this is a good way to make people not want to help you.
I mean what have you tried, what were you expecting, what actually happened, did you see any error messages?

With the code you posted above http://j.maxmind.com/app/geoip.js returns a 404.
This is quite probably the cause of your error.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.