Use to be able to get the images from free code camp API

Use to be able to get the images from free code camp API
0

#1

Hey guys, I was working on my weather app this morning and come to figure out that it can no longer get the images from the free code camp website. Anyone else have similar issues?


#3

It just came back.Thanks.

Can you help me with something else. I am trying to toggle Farenheight to C but cannot seem to do it. Any advice would be much appreciated!
In the code below I was just trying to get my button to hide the temp. I was trying to get my button to affect that line of code but wasn’t even able to do that.
Heres my code


function geolocation(){
if (navigator.geolocation){
    navigator.geolocation.getCurrentPosition(success,error)
    }
}

function error(){
    alert("Thats's weird! We can find you!")
}

function success(position) {

    var x = position.coords.latitude;
    var y = position.coords.longitude;
    var weather = 'https://fcc-weather-api.glitch.me/api/current?lat=' + x + '&lon=' + y;
    //var iconCode = weather + data.weather[0].icon;
     $.ajax({
        url : weather,
        dataType: "jsonp",
        success : function(data) {
            console.log(data);
            //var iconCode = .data.weather[0].icon;
                var cityName = data.name;
                var temp = data.main.temp * 1.8+32;
            $('#location').html('City: ' + cityName);
            $("#temp").html("Temp: " + Math.round(temp)+" F");
            var iconCode = data.weather[0].icon;
            var iconUrl = '' + weather + iconCode + '.png'  
          
         
            
$(".icon").html("<img src='" + iconCode + "'>")
$(".description").html('Outside conditions : ' + data.weather[1].main);


     /* This is where I was trying to get the button to hide the temp information. The button has an ID of hide. The #temp id is where the Temperature for F is being displayed  */

            $("#hide").onclick(function(){
              ("#temp").hide()
            })
function setCelcius(){
  var cel = (temp - 32) * 5/9;
  return cel + "° C";
};           
        }
    });
     };


geolocation();