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