I am Using Google maps api. I cann't find the user location through
the given google.loader.ClientLocation. The code is given below:
<script type="text/javascript" src="
http://www.google.com/jsapi?
key=ABQIAAAAgOuXEvTk7QnQbBVewfG-1BR76dHLW_FiRzipF_h-
YwlJavwRiBSQ0UThRPEca2hcF0vgGxkb-XpEYg"></script>//localhost key
<script language="javascript" type="text/javascript">
google.load("maps", "2.x");
google.load("search", "1");
google.setOnLoadCallback(function() {
if (google.loader.ClientLocation)
{
var cl = google.loader.ClientLocation;
var location = [cl.address.city, cl.address.region,
cl.address.country].join(', ');
document.getElementById('hdnlongitude').value=cl.longitude;
document.getElementById('hdnlatitude').value=cl.latitude;
alert("Welcome to our visitors from "+ cl.longitude +' '+cl.latitude+'
'+location);
}
});
</script>
Everytime --"google.loader.ClientLocation" it is null.
Please help me asap