diff options
author | jan <jan@ruken.pw> | 2016-01-16 18:39:21 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2016-01-16 18:39:21 (UTC) |
commit | b16c4ef8e1ef3458f186139172362a511f925043 (patch) | |
tree | b965638fccbbddee16206c88ba61b76a9656cefc /assets | |
parent | 928ab739e2b4b40077610a7913adb0cf086f2ee1 (diff) |
grils können nun zu listen hinzugefügt werden, da lukas zu faul war. javascript wird vorausgesetzt. grils werden direkt hinzugefügt beim klicken ohne ladezeit. musste dafür ein paar hacks im templating verwenden, da ein gewisser jemand kein frontend framework verwenden will.
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/list.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/assets/js/list.js b/assets/js/list.js index 3a58971..25ff80d 100644 --- a/assets/js/list.js +++ b/assets/js/list.js | |||
@@ -2,7 +2,13 @@ function clickSearchResult(resId) { | |||
2 | var xhr = new XMLHttpRequest(); | 2 | var xhr = new XMLHttpRequest(); |
3 | xhr.onreadystatechange = function() { | 3 | xhr.onreadystatechange = function() { |
4 | if (xhr.readyState == XMLHttpRequest.DONE) { | 4 | if (xhr.readyState == XMLHttpRequest.DONE) { |
5 | alert(xhr.status + ": " + xhr.response); | 5 | if (xhr.status !== 200) { |
6 | alert(xhr.status + ": " + xhr.response); | ||
7 | return; | ||
8 | } | ||
9 | |||
10 | data = xhr.responseText; | ||
11 | document.getElementById("gril-list").innerHTML += data; | ||
6 | } | 12 | } |
7 | } | 13 | } |
8 | xhr.open('POST', window.location, true); | 14 | xhr.open('POST', window.location, true); |