some changes

This commit is contained in:
artem 2023-04-27 12:59:32 +03:00
parent 9be1dab6f3
commit 814ec1e952
2 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,7 @@
<input type="submit" value="Отправить"></p>
</form>
<div id="result"></div>
<img id="image" />
<img id="image" style="max-width: 200px;"/>
</body>
<script src="static/scripts.js"></script>

View File

@ -7,12 +7,17 @@ async function SavePhoto()
let response = await fetch('/beeds', {method: "POST", body: formData});
if (response.ok) {
let json = await response.json();
var text = ""
let text = ""
let uniqChecker = {}
for (let key in json.results_net) {
text += "<div>" + json.results_net[key] + ": " + key + "</div>"
text += "<div>" + json.results_net[key] + ": " + key + "</div>";
uniqChecker[json.results_net[key]] = key;
}
for (let key in json.results) {
text += "<div>" + json.results[key] + ": " + key + "</div>"
if (uniqChecker[json.results[key]] != undefined) {
continue
}
text += "<div>" + json.results[key] + ": " + key + "</div>";
}
document.getElementById("result").innerHTML = text;
let urlCreator = window.URL || window.webkitURL;