This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Lõik loetakse failist. | |
| type Lõik struct { | |
| Algus punktinimi `json:"a"` | |
| Lõpp punktinimi `json:"l"` | |
| Pikkus float32 `json:"p"` | |
| } | |
| var lõigud []Lõik | |
| func loeLõigud() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetch(url) | |
| .then(res => res.json()) | |
| .then((data) => { | |
| // $('#Tulemus').text(JSON.stringify(data, null, 4)); | |
| if (data.status == "success") { | |
| kuvaAndmed(data); | |
| } else { | |
| $('#Teade').text('Andmepäring ebaõnnestus'); | |
| } | |
| }).catch(err => { |