Updated
This commit is contained in:
21
alerts.html
21
alerts.html
@@ -27,8 +27,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="alarm-container">
|
<div class="alarm-container">
|
||||||
<div id="alarms-container">
|
<div id="alarms-container-KBIS">
|
||||||
<p>Loading alarms...</p>
|
<p>Loading KBIS alarms...</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -36,10 +36,10 @@
|
|||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Function to fetch the radar station alarms
|
// Function to fetch the radar station alarms for KBIS
|
||||||
function fetchAlarms(stationId, elementId) {
|
function fetchAlarms_KBIS() {
|
||||||
var apiUrl = "https://api.weather.gov/radar/stations/KMBX/alarms";
|
var apiUrl = "https://api.weather.gov/radar/stations/KBIS/alarms";
|
||||||
var alarmsElement = $("#" + elementId);
|
var alarmsElement = $("#alarms-container-KBIS");
|
||||||
|
|
||||||
$.getJSON(apiUrl, function(data) {
|
$.getJSON(apiUrl, function(data) {
|
||||||
alarmsElement.empty();
|
alarmsElement.empty();
|
||||||
@@ -77,12 +77,13 @@ function fetchAlarms(stationId, elementId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Call the fetchAlarms_KBIS function initially and then every minute for KBIS
|
||||||
// Call the fetchAlarms function initially and then every minute
|
fetchAlarms_KBIS();
|
||||||
fetchAlarms("KMBX", "alarms-container");
|
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
fetchAlarms("KMBX", "alarms-container");
|
fetchAlarms_KBIS();
|
||||||
}, 60000); // 60000 milliseconds = 1 minute
|
}, 60000); // 60000 milliseconds = 1 minute
|
||||||
|
|
||||||
|
// You can create a similar function for fetching alarms for KBIS if needed
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user