geolocation - Save the current device location in one variable in jQuery -


i want save devices current location 1 variable. possible?

you can use geolocation apis current location.

http://mobile.tutsplus.com/tutorials/mobile-web-apps/html5-geolocation/

save location in variable using api have mentioned above as:

var currentlocation; //this variable store current location.      jquery(window).ready(function(){                   jquery("#btninit").click(initiate_geolocation);               });               function initiate_geolocation() {                 //store current location               currentlocation =  navigator.geolocation.getcurrentposition(handle_geolocation_query);               }               function handle_geolocation_query(position){                   alert('lat: ' + position.coords.latitude + ' ' +                         'lon: ' + position.coords.longitude);               }    

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -