You can try something like
jQuery.post({'url':'{{=URL('youraction')}}','data':'a='+position.coords.latitude
+ "&b" + position.coords.longitude)});
On Saturday, 20 October 2012 17:42:15 UTC-5, Michael Gheith wrote:
>
> Hello web2py community!
>
> I have a question:
>
> I know how to get the user's geolocation:
>
> <script>
> if(navigator.geolocation)
> {
> navigator.geolocation.getCurrentPosition(printLocation);
>
> function printLocation(position)
> {
> alert("lat: " +position.coords.latitude + " lon: " +
> position.coords.longitude);
> }
> }
> </script>
>
>
> So my question is this: what's the BEST way to get position.coords.latitude,
> and position.coords.longitude to a controller function?
>
>
--