I've use hidden fields to get values out of javascript when users log in. You just need to add a hidden field and a bit of code to the end of your javascript function:
document.[form name]_frm.[field equate].value = [javascript variable]
You can also use the NetTalk Javascript funtion SetSessionValue([value name], [javascript value]); and then read it in clarion using p_web.gsv([value name])
NetTalk also has location features built in though I haven't used it. You need to call p_web.GetLocation() at the start of the page, and then if the user accepts the data should be available in the following session variables on subsequent requests: _Longitude_, _Latitude_, _Altitude_, _Accuracy_, _AltitudeAccuracy_, _Heading_, _Speed_, _LocationUnixTime_, _LocationDate_=, _LocationTime_, _LocationError_.