Weather.js

JavaScript library for weather in iWidgets, GroovyLock and LHTML.

Download Current Back to Libraries

Getting started

Weather.js is much like miniWeather.js but it provides forecast information.

Each of the commands below are arrays, loop over the array to grab the separate days.

New Commands
w.fDesc
w.fHigh
w.fLow
w.fDay
w.fDaytext
w.fDayshort
w.fIcon

Download Forecast Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<!--include Weather.js -->
<script src="js/Weather.js"></script>


<!-- get weather -->
<script>
Weather({
  code : '38671',
  temp : false,
  lang : 'en',
  gps : false, //must use WidgetWeather xml if set to true
  refresh : 15, // in minutes
  success: function(w){
  var days = 4; //how many days, can also do w.fDesc.length
    for(var i=0; i < days; i++){
    document.getElementById('conditon' + i).innerHTML = w.fDesc[i];                 
    }
  }
});
</script>
Tweet Libraries hosted with ❤ by JunesiPhone