-
Notifications
You must be signed in to change notification settings - Fork 143
Home
Welcome to the jquery.simpleWeather wiki!
A complete demo can be found at monkeeCreate
You must provide either a zip code (US only) or a location. Postal Code’s outside the US are not supported by the Yahoo Weather API (this is a limitation of the Yahoo YQL Weather API and not of this plugin) so you must use a location for international places. For example if your wanting London weather you would set the location to ‘london, united kingdom’. Yahoo API won’t recognize ‘london, uk’ so you must put the complete country.
If you provide a zip code and a location, the location will take priority and will be used over zip code.
Basic Usage
pre. $.simpleWeather({
location: ‘london, united kingdom’,
zipcode: ‘76309’,
unit: ‘c’,
success: function(weather) { … },
error: function(error) { … }
});
Complete Usage
pre. $.simpleWeather({
zipcode: ‘76309’,
unit: ‘f’,
success: function(weather) {
$(“#weather”).append(“
$(”#weather").append("
Today’s High: “weather.high”° “weather.units.temp” – Today’s Low: “weather.low”° “weather.units.temp”
“);$(”#weather").append("
Current Temp: “weather.temp”° “weather.units.temp”
“);$(”#weather").append("
Wind: “weather.wind.direction” “weather.wind.speed” “weather.units.speed”
“);$(”#weather").append("
Currently: “weather.currently” – Forecast: “weather.forecast”
“);$(”#weather").append(‘
’weather.image‘“>
’);$(“#weather”).append("
Sunrise: “weather.sunrise” – Sunset: “weather.sunset”
“);$(”#weather").append("
Last updated: “weather.updated”
“);$(”#weather").append(‘
’weather.link‘“>View forecast at Yahoo! Weather
’);},
error: function(error) {
$(“#weather”).html(“
”+error+"
");}
});