diff --git a/static/main.js b/static/main.js index e2af0a3..b965ee1 100644 --- a/static/main.js +++ b/static/main.js @@ -30,8 +30,6 @@ ready(function() { var searchfield = document.querySelector("#search"); searchfield.addEventListener("keyup", function() { - console.log("Search!"); - var buttons = document.querySelectorAll(".sound"); buttons.forEach(function(item) { @@ -67,3 +65,16 @@ function hideSections() { item.style.display = "none"; }); } + +function ajaxRequest(filename){ + var ajaxRequest; + try{ + ajaxRequest = new XMLHttpRequest(); + var url = "play/" + filename; + ajaxRequest.open("GET", url, true); + ajaxRequest.send(null); + }catch (e){ + alert("Your browser broke!"); + return false; + } +} diff --git a/templates/index.html b/templates/index.html index f65a124..9166151 100644 --- a/templates/index.html +++ b/templates/index.html @@ -38,7 +38,7 @@
тип
{% for sound in sounds %} -
{{ sound.split('.', 1)[0] }}
+
{{ sound.split('.', 1)[0] }}
{% endfor %}