fixing JS code and removing alert on failed calls.

This commit is contained in:
Lucas
2021-11-07 15:52:25 -05:00
parent ec92d1cddf
commit 9919eed55b

View File

@@ -8,11 +8,11 @@ $(document).ready(function () {
dataType: "json", dataType: "json",
async: true, async: true,
data: JSON.stringify({"station": station.find('.station-name:first').get(0).innerText}, null, '\t'), data: JSON.stringify({"station": station.find('.station-name:first').get(0).innerText}, null, '\t'),
success: function (data, text) { success: function (data) {
updateStation(station, data) updateStation(station, data)
}, },
error: function (request, status, error) { error: function (request) {
alert(request.responseText); console.log(request.responseText);
} }
}); });
} }
@@ -20,17 +20,14 @@ $(document).ready(function () {
$.ajax({ $.ajax({
type: "get", type: "get",
url: '/start_time', url: '/start_time',
// contentType: "application/json",
// dataType: "json",
async: true, async: true,
// data: JSON.stringify({"station": station.find('.station-name:first').get(0).innerText}, null, '\t'), success: function (data) {
success: function (data, text) {
console.log("GETTING TIME") console.log("GETTING TIME")
console.log(data); console.log(data);
$("#start_time").text(data) $("#start_time").text(data)
}, },
error: function (request, status, error) { error: function (request) {
alert(request.responseText); console.log(request.responseText);
} }
}); });
} }