From f268ee7a54dd486c7f2ff6207bca018a110fffd1 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Tue, 29 Sep 2020 22:29:20 -0500 Subject: [PATCH] remove first $.ajax --- server/scripts/index.js | 2 +- server/scripts/modules/navigation.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/scripts/index.js b/server/scripts/index.js index 45f9187..f4a05c0 100644 --- a/server/scripts/index.js +++ b/server/scripts/index.js @@ -99,7 +99,7 @@ const index = (() => { if (TwcQuery) { _AutoSelectQuery = true; const txtAddress = document.getElementById('txtAddress'); - txtAddress.val(TwcQuery); + txtAddress.value = TwcQuery; txtAddress.blur(); txtAddress.focus(); } diff --git a/server/scripts/modules/navigation.js b/server/scripts/modules/navigation.js index 61a5ccb..9d28f08 100644 --- a/server/scripts/modules/navigation.js +++ b/server/scripts/modules/navigation.js @@ -57,12 +57,12 @@ const navigation = (() => { const point = await utils.weather.getPoint(latLon.lat, latLon.lon); // get stations - const stations = await $.ajax({ + const stationsResponse = await fetch(point.properties.observationStations, { + method: 'GET', + mode: 'cors', type: 'GET', - url: point.properties.observationStations, - dataType: 'json', - crossDomain: true, }); + const stations = await stationsResponse.json(); const StationId = stations.features[0].properties.stationIdentifier;