Help in console

Hi guys please help me out, my console screen is not printing my console outputs, here is the code : -
And i also wanted to know if i have used long and lat variables correctly in the api link or not ?

  var long;
  var lat;
  var fTemp;
  var cTemp;
  if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
   long = position.coords.longitude;
    lat= position.coords.latitude;
  var api="'+lat+'&lon='+long+'&appid=bb77b854a0c13e495d0e46e97477b034";
  $.getJSON(api, function(data){
    var weatherType[0].description;
    var kTemp = data.main.temp;
    var windspeed = data.wind.speed;
    var city =;
     fTemp= (kTemp)*(9/5)-459.67;
    cTemp = kTemp-273;

You’re using an API that’s served over HTTP, which HTTPS apps don’t like. You can see an error in the console that says Blocked loading mixed active content "".

The quotation marks that you used in the URL are also inconsistent. You should change the single-quotes to double-quotes.

Try using this instead:

hi so for this API i dont need an api key ?

Yeah. You just need to plug in a latitude and longitude.

Nice !!! so ill just plug in the long and lat variable in this and it will work !!

Thank you very very much it works now !! :smiley:

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


Thank you :smiley: ill keep in mind !