10 Replies
OWEN HOLT

I don't know about IP, but if they have geolocation turned on... you can get latitude and longitude.

var fail;
var latitude;
var longitude;
function getLocation() {
     if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(showPosition);
     } else {
        fail = "Geolocation is not supported by this browser.";
        console.log(fail);
     }
};

function showPosition(position) {
     latitude = "Latitude: " + position.coords.latitude;
     longitude = "Longitude: " + position.coords.longitude;
     console.log(latitude);
     console.log(longitude);
};

getLocation();

You can, of course, send this back to a SL variable.