I have developed an event registration website in PHP. When users view the event, I have to show the weather condition of that location. I've got the code from
https://openweathermap.org/widgets-constructor
And Code is here:
<div id="openweathermap-widget-14"></div>
<script>
window.myWidgetParam ? window.myWidgetParam : window.myWidgetParam = [];
window.myWidgetParam.push({
id: 14,
cityid: '1254589',
appid: '<appId>', // Anonymised appId
units: 'metric',
containerid: 'openweathermap-widget-14',
});
(function () {
var script = document.createElement('script');
script.async = true;
script.charset = "utf-8";
script.src = "//openweathermap.org/themes/openweathermap/assets/vendor/owm/js/weather-widget-generator.js";
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(script, s);
})();
</script>
But I want know how to pass city id dynamically