Displaying Weather Data from Ajax using simpleWeather.js

If you have completed an application and wish to share the complete source/project files with everyone then please post it in here. Source-code files only, no tutorials.
1 post Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

See it in Action on Codepen: https://codepen.io/mikethedj4/pen/MepVBx
See it in Action on kodeWeave: https://mikethedj4.github.io/kodeWeave/ ... 32e2943d2c

Screenshot:
Image

This is made possible using a JQuery plugin called simpleWeather. Please refer to http://simpleweatherjs.com/ for all the information about this plugin.

Here's a basic demonstration of simpleWeather.
Code: Select all
var loadWeather = function(location, woeid) {
  return $.simpleWeather({
    location: location,
    woeid: woeid,
    unit: 'f',
    success: function(weather) {
      $('.location').text(weather.city);
      $('.temperature').html(weather.temp + '°' + weather.units.temp);
      $('.climate_bg').html('<i class="icon icon-' + weather.code + '">');
      $('.humidity').text(weather.humidity + '%');
      return $('.windspeed').text(weather.wind.speed + weather.units.speed);
    },
    error: function(error) {
      return $('.error').html('<p>' + error + '</p>');
    }
  });
};

loadWeather('Chicago, IL', '');
Please refer to http://simpleweatherjs.com/ for all the information about this plugin.
1 post Page 1 of 1
Return to “Source-Code”