/
index.html
18 lines (18 loc) · 1.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<label for="omniva-location">Omnivas adrese: </label>
<select name="omniva-location" id="omniva-location" data-name="omniva-location" class="w-select">
<option value="" selected></option>
</select>
</div>
<script>"use strict"; function x(t) { var n = document.createElement("OPTION"), e = document.getElementById("omniva-location"), o = y(t); n.innerText = o, n.value = o, e.appendChild(n) } function y(t) { var n = t.A5_NAME + " " + t.A7_NAME + ", " + z(t); return t.NAME + " - " + n } function z(t) { var n; return t.A3_NAME ? n = t.A3_NAME : t.A2_NAME ? n = t.A2_NAME : t.A1_NAME && (n = t.A1_NAME), n } fetch("https://www.omniva.lv/locations.json").then((function (t) { return t.json() })).then((function (t) { t.forEach((function (t) { "LV" === t.A0_NAME && x(t) })) }));</script>
</body>
</html>