$.getJSON("http://ipinfo.io", function(data){
data = { name: data.city + " " + data.country, coords: {
latitude: data.loc.split(',')[0], longitude: data.loc.split(',')[1]
}}
showPosition(data);
})
function showPosition(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
$.getJSON("http://api.openweathermap.org/data/2.5/weather?lat="+latitude+"&lon="+longitude+"&APPID=02c0da530b8cf7771cee190bae9256af",function(data){
var city = data.name;
var temp = data.main.temp;
.... //and so on
:star2: 1266 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
:warning: 2irina2 already gave marhyorh points
$(window).load(function(){
$('.tempf').hide();
});
$('.tempf,.tempc').click(function(){
$('.tempf,.tempc').toggle();
});
background-color: #722872 !important;
height: 80px;
border-color: #592059;
}
#banner {
background-color: #722872 !important;
height: 80px;
border-color: #592059;
}
:star2: 1267 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
anyone know why when you click the "online" button and then the "all" button on my twitch viewer, the "offline" shows up for a split second before the "online" section does? ideally, i'd like a smooth transition without the offline users coming up briefly before the online...