Get Geographice Location Within Browser

// Get the current location
navigator.geolocation.getCurrentPosition(showMap);

function showMap(position) {
// Show a map centered at position
latitude = position.coords.latitude;
longitude = position.coords.longitude;
}

// Register for location changes
var watchId = navigator.geolocation.watchPosition(posChangeCallback, handleError);

function posChangeCallback(position) {
// Scroll the map to center position
}

function buttonClickHandler() {
// Unregister when the user clicks a button
navigator.geolocation.clearWatch(watchId);
}

function handleError(error) {
// Update a div element with the error message
}

Reference: http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/GettingGeographicalLocations/GettingGeographicalLocations.html