/* * Initialization script for Weather panel */ jQuery(function($){ "use strict"; var enable_static_weather = function( elements ){ if(elements && ( typeof($.simpleWeather) != 'undefined')){ $.each(elements, function(i, e){ var self = $(e), loc = self.attr('data-location') ? self.attr('data-location') : ''; $.simpleWeather({ woeid: self.attr('data-woeid'), location: loc, unit: self.attr('data-unit'), success: function(weather) { console.warn(weather); var html = '
'+error+'
'); console.warn('Some problems: '+ error); } }); }); } }; var weatherWrapper = $('.sc__weather'); if(weatherWrapper){ enable_static_weather( weatherWrapper ); } });