Updated double load
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Function to fetch the radar station alarms
|
// Function to fetch the radar station alarms
|
||||||
function fetchAlarms(stationId, elementId) {
|
function fetchAlarms(stationId, elementId) {
|
||||||
var apiUrl = "https://api.weather.gov/radar/stations/" + stationId + "/alarms";
|
var apiUrl = "https://api.weather.gov/radar/stations/KMBX/alarms";
|
||||||
var alarmsElement = $("#" + elementId);
|
var alarmsElement = $("#" + elementId);
|
||||||
|
|
||||||
$.getJSON(apiUrl, function(data) {
|
$.getJSON(apiUrl, function(data) {
|
||||||
@@ -77,10 +77,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Call the fetchAlarms function initially and then every minute
|
// Call the fetchAlarms function initially and then every minute
|
||||||
fetchAlarms("KBIS", "alarms-container");
|
fetchAlarms("KMBX", "alarms-container");
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
fetchAlarms("KBIS", "alarms-container");
|
fetchAlarms("KMBX", "alarms-container");
|
||||||
}, 60000); // 60000 milliseconds = 1 minute
|
}, 60000); // 60000 milliseconds = 1 minute
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user