Last active
June 23, 2016 14:11
-
-
Save etozzato/1935581b612a00933aee9bc13ddf9474 to your computer and use it in GitHub Desktop.
simpy ex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.geolocation.getCurrentPosition(function(pos) { | |
var coords = pos.coords; | |
var weatherUrl = 'http://api.openweathermap.org/data/2.5/weather?' + | |
'lat=' + coords.latitude + '&lon=' + coords.longitude + '&units=metric'; | |
ajax({ url: weatherUrl, type: 'json' }, function(data) { | |
simply.text({ title: data.name, subtitle: data.main.temp }); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment