21 lines
535 B
HTML
21 lines
535 B
HTML
<div id="{{ app_id }}" class="weather"></div>
|
|
<script>
|
|
$(function(){ //DOM Ready
|
|
$.simpleWeather({
|
|
zipcode: '',
|
|
woeid: '{{ location }}',
|
|
location: '',
|
|
unit: 'c',
|
|
success: function(weather) {
|
|
html = '<h2>'+weather.city+'</h2>';
|
|
html += '<img width="125px" src="'+weather.image+'">';
|
|
html += '<p>'+weather.temp+'° '+weather.units.temp+'</p>';
|
|
$("#{{ app_id }}").html(html);
|
|
},
|
|
error: function(error) {
|
|
$("#{{ app_id }}").html('<p>'+error+'</p>');
|
|
}
|
|
});
|
|
});
|
|
</script>
|