I know there are more accurate geolocation methods, but I want to have it transparent to the user rather than ask them to "allow".
I am using a very simple method and it works great on most of the computers I have tried, but on some such as my grandmothers laptop with IE7 I think and Windows XP, as well as a friends MAC, it did not work.
I figured that even if the location database came up empty, the else statement should fill in for New York, no?
What am I missing? thanks.
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">// <![CDATA[
if (typeof(google.loader.ClientLocation.address.city) != null) {
document.write(google.loader.ClientLocation.address.city);
} else {
document.write("New York");
}
// ]]>
</script>