Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(mia_posizione);
- }else{
- alert('La geo-localizzazione NON è possibile');
- }
- var pos = []
- //Non posso usare questa funzione nel file 2.js perchè non ho la variabile position
- function mia_posizione(position) {
- var lat = position.coords.latitude;
- var lon = position.coords.longitude;
- pos = [lat,lon]
- document.getElementById('posizione').innerHTML = 'La tua posizione: ' + lat + ',' + lon;
- }
- function ritornaArray()
- {
- //Mi ritorna l'array vuoto
- return pos
- }
Advertisement
Add Comment
Please, Sign In to add comment