Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

how to use widgets

Christopher Lucas Jun 09, 2017 11:33AM MSK

I'm using this api for a school project. I getting the hang of it slowly but i can't understand the widgets. I'm trying put my informations in it but I keep get errors. i was hoping that somebody could explain to me how to use the code that is given.
have a nice day

Up 1 rated Down
Maxim Gushcho Jun 09, 2017 01:04PM MSK OpenWeatherMap Agent

Hello Chris,

Could you please check how you input the data. It should be without empty spaces in the fields.
If errors appears again then attach the screen and provide an API key.

Up -1 rated Down
Christopher Lucas Jun 09, 2017 02:35PM MSK
Hi, thanks for the advice. I found the list of parameters on the website and it help me. Could you help me understand this? Because now I want to add the widget to a view and I keep getting a text content is null.

window.myWidgetParam ? window.myWidgetParam : window.myWidgetParam = [];
Up 0 rated Down
Christopher Lucas Jun 09, 2017 02:43PM MSK
This is my code:
function _effectuerWeather(){
var city = $('#location').val();
if (city !== '') {
url: '' + city + '&units=metric' + "&APPID=f1206b03d1c67d06c3697b0eff1e3bde",
type: "GET",
dataType: 'jsonp',
success: function (data) {
} else {
$('#error').html('Field cannot be empty');
function _show(data) {
window.myWidgetParam ? window.myWidgetParam : window.myWidgetParam = [];
id: 24,
appid: 'f1206b03d1c67d06c3697b0eff1e3bde',
units: 'metric',
containerid: 'openweathermap-widget-24'
}); (function() {
var script = document.createElement('script');
script.async = true;
script.src = "";
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(script, s);

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found