JSFiddle - React, Tailwind, and code Playground
by Chris Hughes
JavaScript
//Sets the icons for the menu buttons (info)
$(function () {
$("button:first").button({
icons: {
primary: "ui-icon-info"
},
text: false
});
});
//Sets characteristics for fancyBox
$(document).ready(function () {
$('.fancybox').fancybox({
padding: 10,
'height': 300,
'width': 1000,
'autoSize': true,
closeClick: true,
closeBtn: true,
helpers: {
title: {
type: 'inside'
}
// buttons: {}
}
});
});
function getStationData(station_code) {
//Reading the Year from the File
$.getJSON('WATER_LEVELS/read_climate_file.php?test_variable=0&station_code=' + station_code, function (data) {
the_results = data;
});
the_year = the_results;
for (var ii = 0; ii < the_year.length; ii++) {
the_year[ii] = +the_year[ii];
}
//Reading the Month from the File
$.getJSON('WATER_LEVELS/read_climate_file.php?test_variable=1&station_code=' + station_code, function (data) {
the_results = data;
});
the_month = the_results;
for (ii = 0; ii < the_month.length; ii++) {
the_month[ii] = +the_month[ii];
}
//Reading the Day from the File
$.getJSON('WATER_LEVELS/read_climate_file.php?test_variable=2&station_code=' + station_code, function (data) {
the_results = data;
});
the_day = the_results;
for (ii = 0; ii < the_day.length; ii++) {
the_day[ii] = +the_day[ii];
}
//Reading the Time from the File (hh:mm)
$.getJSON('WATER_LEVELS/read_climate_file.php?test_variable=3&station_code=' + station_code, function (data) {
the_results = data;
});
the_time = the_results;
//Reading the Water-Level from the File (m)
$.getJSON('WATER_LEVELS/read_climate_file.php?test_variable=4&station_code=' + station_code, function (data) {
the_results = data;
});
water_level =...