General

Get geo location of an iOS and Android devices using JavaScript

How to get Geo location of an iOS and Android devices using JavaScript

Generally ,whenever  web developer  developing  an mobile website,
then most of times they need  to fetch current location of device(ipod,ipad,android).
That time we use  JavaScript  to  fetch current location.Which most  used full.
navigator.geolocation.getCurrentPosition(foundnearLocation, noLocation);
 
function foundnearLocation(currentposition)
{
var lat = currentposition.coords.latitude;
var long = currentposition.coords.longitude;
alert('Found location: ' + lat + ', ' + long);
}
function noLocation()
{
alert('Could not find location');
}