File size: 574 Bytes
59ebac7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const coordsGenForm = document.querySelector(".coords-gen-form");

const segmentCoords = async (coords) => {
  const inferResponse = await fetch(`infer_samgeo?input=${coords}`);
  const inferJson = await inferResponse.json();

  return inferJson.output;
};

coordsGenForm.addEventListener("submit", async (event) => {
  event.preventDefault();

  const coordsGenInput = document.getElementById("coords-gen-input");
  const coordsGenParagraph = document.querySelector(".coords-gen-output");

  coordsGenParagraph.coordsContent = await segmentCoords(coordsGenInput.value);
});