Search code examples
javascriptjqueryjsonapiweather-api

getJSON no output?


I can't for the life of me figure out why this is not working?

<div class="clouds">

</div>

<div class="station">

</div>

<script type="text/javascript">
$.getJSON("http://api.geonames.org/findNearByWeatherJSON?lat=53.36652&lng=-2.29855&username=jolones&callback=?",
function(data){

          var clouds = data.weatherObservation.clouds;
          var station = data.weatherObservation.stationName;

      jQuery.(".clouds").html(clouds);
      jQuery.(".station").html(station);

      });

Much appreciation


Solution

  • jQuery . (".clouds").html(clouds);
    jQuery . (".station").html(station);
    

    Do you mean to have those dots there? Should be

    jQuery(".clouds").html(clouds);
    jQuery(".station").html(station);